cancel
Showing results for 
Search instead for 
Did you mean: 
marc_jornet
Nintex Newbie

Update Item Field based on WFproperty

Hi there,

I'm getting some troubles to update a field on an item using OOTB actions.

On list A, a user initiating the WF is selecting a "Type of Absence" from a dropdown menu.

On list B we got a list with a User field and a numeric field for every "Type of Absence" from the dropdown on list A.

There is any way to update the field on list B using OOTB actions?

Every action I use, there is no option to set a dynamic value when you choose the field to update.

Kind regards,

Labels: (1)
Tags (1)
Reply
15 Replies
Automation Master
Automation Master

Re: Update Item Field based on WFproperty

Hi!

Can you clarify your issue a bit? Do I understand you correctly, that you want to subtract number of available day per user, once his request for a specific absence type is approved?

In such case - just use the "Update List Item" action to set the new value. You are right - you cannot do it dynamically, ex. in a single action get current value, subtract it and update.

You first need to get the current value, using a "set variable" or any other action, where you can set a variables value using "advanced lookup". Then subtract it and finally using the "Update List Item" action set the new value.

Regards,

Tomasz

Reply
marc_jornet
Nintex Newbie

Re: Update Item Field based on WFproperty

Hi Tomasz,

My issue comes when i have to select which field is needed to update.

On list B i got a register with Person A - Type1 - Type2 - Type3 where TypeX are the remaining hours for an specific type of absences.

On the listWF on listA, the person is selecting 1 type of absences from a dropdown (Type1 - Type2 - Type3).

After the WF is approved I need to update the remaining hours for the selected type of absence.

Using the UpdateListItem action, it is not possible to assign a WFvariable where I saved the Type on the field to update right?

Which would it be the best solution? Making as many conditional branch as types there are, and update the type depending on the branch or it would be better to use WebService calls?

Thanks for all,

Reply
Automation Master
Automation Master

Re: Update Item Field based on WFproperty

Hold your horses

Right, so once again the scenario:

  1. You have two lists - users' leave requests (A) and users' leave quotas (B).
  2. User places new leave request on a list A
  3. The request gets approved
  4. Now you need to subtract the approved amount, for the approved leave request type, for a specific user, from the list B.

I see two options. Ok, three to achieve what you need:

  1. The "Update List Item" action allows you to provide just a single "filter" rule. So you can select an item to be updated using ex. the user as a comparison. To overcome it, you can query all the quotas, that belongs to the requester, then subtract the one, that got approved, and then using the action update all quotas, having in mind, that in the end only one will be changed.
  2. OR you can do, as you wrote - create a switch action, and in each branch of that switch do an update of a specific quota.
  3. OR you can use the "Office 365 Update Items" action (be aware, it requires much more time for completion, as it is executed outside of your tenant) and in the "Fields to update" dynamically pass the field name you want to update. This approach is far more the most flexible, so in case you add a new absence type, you won't need to update the whole workflow

Please, let me know if the information I provided helped you.

Regards,

Tomasz

Reply
marc_jornet
Nintex Newbie

Re: Update Item Field based on WFproperty

Hi Tomasz,

It's so useful, just a question.

I tried to fill the field value under Fields to Update with a WFvariable named AbsenceType and that brings the column name that I want to update. I'm filling it that way:

But it is not working...any special format to the field that i have to use?

Thanks again!

0 Kudos
Reply
Automation Master
Automation Master

Re: Update Item Field based on WFproperty

Be sure the field, on the list B ist the "Number" type. Maybe you have used a different type. Also - check if the display name is equal to internal name of the column you want to update. You should provide there the internal name, but... maybe try also with the display name

Reply
marc_jornet
Nintex Newbie

Re: Update Item Field based on WFproperty

Not working mate

The internal name is Maternidad, same as display name.

The type of the field is Number.

If I hardcode Maternidad on the field it is being updated properly.

I'll go for "option B", but I have like 10 types of absence, and it will be a very "ugly" WF development.

Kind regards,

0 Kudos
Reply
Automation Master
Automation Master

Re: Update Item Field based on WFproperty

That may be the reason... If you pass column name as a variable it doesn't work. But still, this is weird. It should have!

Are you sure your variable contains a correctly typed value, correct size of cases, no white spaces?

If still no luck, then the last possible solution is to use the "Call HTTP Web Service" action, knowing the ID of the item, from the list B you want to update:

The "var_Headers_Dict":

The "var_Body_Metadata_Dict":

The "var_Body_Dict" (your <qouta-field> along with the value should be set dynamically):

Check it out. That solution should do the trick. Also, get more familiar with the SharePoint REST Endpoints documentation here: Lists and list items REST API reference .

Regards,

Tomasz

Reply
marc_jornet
Nintex Newbie

Re: Update Item Field based on WFproperty

Hi Tomasz,

Same response, I'm not able to set the <quota-field> as a dynamic value

Am I doing something wrong or is it just impossible to achieve that via dynamic values?

If I put one of the column Names hardcoded where now you see {Variable:TipoA...} it is working, but if I try to set the value from a WFVariable, there's no way.

Keep in touch,

Regards,

0 Kudos
Reply
Automation Master
Automation Master

Re: Update Item Field based on WFproperty

Err... Right. My fault. You cannot set it there dynamically.

So the only approach left is the "Web Request" action, where you build headers and URL request strings dynamically. You have to build the whole request body yourself.

The only thing, to keep in mind - Nintex Workflow has problems with string variables starting and ending on brackets { and }).

To achieve that, simply create a string, having ex. ### in the beginning and @@@ in ending, and then replace them using "regex" action with { and }.

Regards,

Tomasz

0 Kudos
Reply