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
$item.update()
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):
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 a string variable with ;# as a value
Workflow error: Coercion Failed: Unable to transform the input lookup data into the requested type.
- 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
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 -1 as a value
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 a person variable:
Workflow error: Coercion Failed: Unable to transform the input lookup data into the requested type.
- Set it to a List Lookup to the lookup list with a condition that should return nothing:
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 List Lookup to the column itself (which is logging empty string in the history):
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)