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,
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
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,
Hold your horses
Right, so once again the scenario:
I see two options. Ok, three to achieve what you need:
Please, let me know if the information I provided helped you.
Regards,
Tomasz
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!
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
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,
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
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,
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