4

Using SP2013, SPD2013, 2013 Workflow

I'm building some workflows that, at various stages, need to clear the data from a field. In this case it is a "Person or Group" field. The way I'm trying to do it is using the Update List Item action on the Current Item, adding the field to the dialog and leaving the value blank. This seems to work for strings, but the Person or Group field (when examined after the update) contains a value of: ,#,#,#,#

Is there another way to blank out this field or set it to null?

Quick update: Tried creating a workflow variable (string) and not assigning it a value, then setting the field equal to that variable does not work. Since the variable is blank it does not show up as an option when setting the value of the field.

I should also note that in a 2010 workflow (on the same 2013 list), using the Update List Item action and setting the field to a blank value works perfectly, it only stopped working when I rebuilt the workflow in the 2013 format.

  • If the item you want to update is the current item you could try " set Field in Current Item" option ? – n0r1s Dec 18 '13 at 14:47
  • Just tried it, but the "Value" field can't be blank, and I can't find any choice for "Null" or something like it. – thanby Dec 18 '13 at 15:22
  • I just tried to my sharepoint site doing what you described and it worked to me – n0r1s Dec 18 '13 at 16:51
  • Definitely the only solution that worked with me - apart from REST API - is the 2010 Workflow – Marpio Jun 5 '17 at 7:29
4

I know that this is an ancient post but I have been so frustrated with this issue too in 2016 but I have found a cure and hope that it can help someone else.

When making the workflow, if you log the Person Field string, you will get this string or something similar:

{"__metadata":{"type":"Collection(Edm.Int32)"},"results":[19,11]}

The user IDs of the people in this field are listed at the end as User IDs. By setting the user IDs to 0, you effectively make the field empty.

I used the Replace command to set a string variable to ' "results":[0] ' (without the small quotes but with the double quotes).

Then use the Update or Set command to set your field to that variable.

I have struggled with this for a few days and then accidentally managed to make it work. Hope this helps someone else and saves them a massive headache.

1

I've done this by using an Initiation Form Parameter called nullString of type Single Line of Text, and not setting the Default value. Then I can set values and variables elsewhere equal to this parameter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.