Skip to main content
Nintex Community Menu Bar
Solved

How to set a person or group field to empty in Nintex Workflow

  • December 29, 2015
  • 24 replies
  • 833 views
  • Translate

Forum|alt.badge.img+3

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

Best answer by praveen_thallur

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.

View original
Did this topic help you find an answer to your question?

24 replies

Forum|alt.badge.img+17
  • 1129 replies
  • December 29, 2015

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.

Translate

Forum|alt.badge.img+3

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."

Translate

Forum|alt.badge.img+17
  • 1129 replies
  • December 29, 2015

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.

Translate

Forum|alt.badge.img+3

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! 

Translate

Forum|alt.badge.img+17
  • 1129 replies
  • December 30, 2015

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.

Translate

Forum|alt.badge.img+3

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.

Translate

Forum|alt.badge.img+17
  • 1129 replies
  • December 30, 2015

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

Translate

Forum|alt.badge.img+3

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!

Translate

Forum|alt.badge.img+17
  • 1129 replies
  • January 7, 2016

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

Translate

Forum|alt.badge.img+9
  • 56 replies
  • January 18, 2016

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

Translate

Forum|alt.badge.img+17
  • 1129 replies
  • January 18, 2016

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

Translate

Forum|alt.badge.img+8
  • 73 replies
  • May 18, 2016

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

Translate

Forum|alt.badge.img+17
  • 1129 replies
  • May 23, 2016

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

Translate

Forum|alt.badge.img+3

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:

Translate

Forum|alt.badge.img+17
  • 1129 replies
  • May 24, 2016

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

Translate

Forum|alt.badge.img+8
  • 73 replies
  • May 27, 2016

Hey Matthew,

have you tried it on another site collection?

And gave it the same result?

Regards

Oliver

Translate

Forum|alt.badge.img+3
  • Novice
  • 17 replies
  • May 3, 2017

This worked for me in O365. Thx!

Translate

TomaszPoszytek
Forum|alt.badge.img+17

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

Translate

Forum|alt.badge.img+1

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.

Translate

barryc
Forum|alt.badge.img+5
  • 43 replies
  • January 15, 2018

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

Translate

  • 11 replies
  • January 22, 2020

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.

Translate

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 

Translate

BAFegles
  • 1 reply
  • July 14, 2021

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.

 

 

Translate

  • Novice
  • 1 reply
  • November 4, 2021
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!
Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings