Skip to main content

Hi,

 

I cant get this to work properly. I have a person or group field on a list and at the end of the workflow, I want to clear the field. I'm using the 'Set Field in Current Item' action currently to set the field to a blank variable. This seems to only partially remove the user entity from the field though as the edit form is broken for the specific item when the workflow has ran. I can also see on the display form that the field still contains some information. Any help on how to do this would be appreciated.

 

Thanks

Try setting it to the value of a space character. Just hit the space bar once within the set field action. Let me know if you still have issues.


Thanks - just tested this though and get an error on publishing the workflow. I've confirmed that it doesn't like setting the value as a space within the set field action by testing with only that action in the workflow.

"Error publishing workflow. Workflow XAML failed validation due to the following errors: The private implementation of activity '1: DynamicActivity' has the following validation error: Value for a required activity argument 'Operand' was not supplied. HTTP headers received from the server - ActivityId: 34d64f90-d825-44cd-abee-421efb244424. NodeId: . Scope: . Client ActivityId : cf09509d-6069-2000-0d0b-d7f608582633. The remote server returned an error: (400) Bad Request."


yes, the validation doesn't seem to understand how to save this or that it knows this is invalid. Save a space value into a Single Line of Text variable and use its value to set the Person field.


Thanks, but surprisingly I still get the same error when publishing if I use a variable with space in it. I'll work around this for now by not using a person or group field, but think Nintex need to add a simpler way of doing this! 


So I did some searching and found that this is a very common occurrence for SharePoint 2010 and 2013 workflows for this field type. That is why Nintex is also affected. One solution was to create a Single Line of Text string as an initiation variable and not set it's default value and not provide one when the workflow starts. Then use this workflow variable as a null string throughout the workflow.

I tried this in my online tenant and I was now able to publish the workflow, but the process didn't seem to work. It may on premise, can you try this? Also, if this is the case, I wonder if turning of validation then running the workflow is all that is needed.


Yes, that may be the case. Unfortunately though, I don't have access to an on premise environment to check. It looks like there is currently no way to do this with NWF online.

Thanks for looking in to it Andrew.


Don't give up. We haven't tried everything i'm sure.


Hi,

I tried this previously, but couldn't get it to work. Is your workflow for the 365 version of NW? If I create a variable of person type, it forces it to be a initialization variable and requires the user to enter the value before the workflow runs. If I use an action to set it to blank, the workflow runs, but I seem to get the same problem of the field not being fully cleared. It may be something to do with the way I'm configuring it!


It may be that O365 just wont let it be set to null and you can on prem.


FYI, using the Update List Item action, I am clearing people fields.

In my scenario (O365), I have a process where I lookup the manager and manager's manager for an employee.

Unfortunately due to some silly stuff in our HR department, occasionally the manager and manager's manager are blank, and once I query it using call HTTP web service, I set the resulting value to a variable (Manager1 and Manager2), then use the update list item to set it.

If it is blank, it successfully updates the Managers name field to blank


Awesome thanks Brent!, Matthew Reaveley, have you tried this out?


Hello,

I had the same issue.

The following worked for me.

Set a workflow variable (Type Collection), with the User-/Group-Column which should set to null / empty

Use the "Clear Collection" Action, to remove all entries from the workflow variable

Use the "Update List Item" Action, to set the Column with the empty workflow variable


Matthew Reaveley​, do any of these answers provide a solution for you?


Thanks for the responses. I've moved on from this now, but tested Oliver's answer and still got the same result.

The item before the workflow runs:

The workflow:

After:

When trying to edit this item:


Ok thanks for feedback. It's good to know that it does clear the value, but seems to cause another issue.


Hey Matthew,

have you tried it on another site collection?

And gave it the same result?

Regards

Oliver


This worked for me in O365. Thx!


Hi! Just pinging to find out whether you found a solution or still looking for it? If yes (if you found) - can you write here how you achieve that? 

I'm doing it this way:

  1. I'm declaring the "People" variable under the "Variables", but then in workflow, I'm not assigning any value to it.
  2. Then I'm just using this only-declared variable for comparison and... it works. This variable, when logged to history, seems empty.

 

Regards,

Tomasz


This might work.

1. Define a workflow variable of type Person or group and leave default value as empty.

2. Use this variable as a value to set a list item user column or another workflow variable.


Hi Tomasz,

Was your "People" variable a text variable or a Person/Group variable?

I tried first with a Person/Group variable (in a site workflow), but when selecting that variable type it was automatically set as an initiation parameter (appears on start form) and I could not change that.

When I used a text variable, the workflow did not report any error, but the person column (multi-select) was not set to null...it just kept the values that were already in the column.

Cheers,

Barry


This solution not work for me in this time (2020).



However, I found another solution, it is just set the field value as "[]" (no need double qoute)



It mean set the field as a empty array.


Just encountered this same issue today (Nintex for Office workflow) and can affirm that GP's solution of setting field equal to [] worked like a charm after attempting the null person setting. @GP 


Hello! I've tried all the solutions mentioned here but none of them seem to be working as intended. At least not completely. 

While setting a person field with a value of [] or using Update List Item without entering anything in the value area does make the field appear to be blank, it isn't. When I try to update the list item, this is what appears in the person field




It displays blank but if you update the item afterward, you get an error and need to manually delete that null entry from the person field.



 



 


This works perfectly in my Nintex O365 workflow environment. Thank you so much.
Not sure why Nintex does not add those in the action documentation so it does not drive so many people insane.
Again, thank you!

Reply