I have a scenario where I want to set a lookup column to null from the workflow, as if the value was never selected.
Something equivalent to this PowerShell but in Nintex Workflow:
$item["ColumnName"] = $null
Thank you in advance
setting value to zero should do the job
Thank you Marian, but I actually tried this before posting the question and it is not working as 0 is not a valid value for a lookup and it gives an error when you open the form (The same as this one: https://community.nintex.com/message/45513?et=watches.email.thread#comment-45513)
then that might be as well some bug introduced with recent release(s).
it works in my env, but I'm not on the most recent release yet.
if you try to write value of lookup column which haven't had set any value yet to history log, does it provide some output/value?
The workflow show nothing (empty string) in the log when logging the unselected lookup the same when logging the deleted lookup. But using PowerShell it will show you the saved value if it is deleted.
one more idea - let's try to create workflow variable of type 'List item ID' and try to assign it to a list column that you want to clear.
Marian, keep thinking (Y)
I actually tried this one as well yesterday and it gives an error "Coercion Failed: Unable to transform the input lookup data into the requested type."
By the way this is working for columns of type person.
what about to try to feed it with ";#" or "0;#" ?
- Set it to empty string variable:
Workflow error: Coercion Failed: Unable to transform the input lookup data into the requested type.
- Set it to empty lookup ID variable:
Passed workflow, error on form: One or more field types are not installed properly. Go to the list settings page to delete these fields.
- Set it to empty lookup ID variable (with Return Type: Item Id):
- Set it to a string variable with ;# as a value
- Set it to a string variable with 0;# as a value
Passed Workflow, error on form: An unexpected error has occurred. (the same as https://community.nintex.com/message/45513?et=watches.email.thread#comment-45513)
- Set it to a number variable with 0 as a value
- Set it to a number variable with -1 as a value
- Set it to a person variable:
- Set it to a List Lookup to the lookup list with a condition that should return nothing:
- Set it to a List Lookup to the column itself (which is logging empty string in the history):
it seems the functionality is really broken an the best would to involve nintex support into that just like for the other thread.
Have you found an answer to this problem? This is crazy that it's not easier.
Right now they are working on fixing it, we have an opened ticket for this issue (https://community.nintex.com/message/45513?et=watches.email.thread#comment-45513) and once fixed it will make setting to null easier, as any of the above options will be a valid option.
Tested with "Update item" action or "Set field value" action in NWF with zero ("0") and they both worked.
Retrieving data ...