We're building a Nintex WF on SP2013 to update various lists we reuse on multiple site collections within our farm. In cases when list items need to be updated, we're using the Web Request action successful to update text & other fields. However, multiple attempts to update a person/group field type has failed, except in one case.
The person/group field we're using tracks a single owner's name for this particular Functional Area (think department manager). There are several options for assigning a person/group field to a variable - and all but one failed when passed in the in the request (see XML below):
Has anyone else experienced this problem - and is it by design?
The additional problem this creates is that the User Profile list appears to be generated for each site collection and the ID's are not the same from one site collection to the next. I've been able to verify this by visiting the profile pages for a single user on multiple site collections & the ID's vary.
So it seems one would be able to use something like a Web Call to the UserProfileService.asmx & the GetUserProfileByAccountName method to find the ID. Unfortunately, I've been unable to find the documented property of the lists ID for that user. Any clues to what this might be?
<?xml version="1.0" encoding="utf-8"?>
<Batch OnError="Continue" ListVersion="1">
<Method ID="1" Cmd="Update">
Solved! Go to Solution.
You can try this out.
User Field Format:
Single user = [ID];#[Person]
Multi user = [ID];#[Person];#[ID];#[Person];#[ID];#[Person];#
if you don't know the ID of the person, you could use -1
Example: -1;#Display Name
Thanks for the response. I was able to modify the update XML so that it works using the Display Name. Based on Robyn's reply the Login name works as well. For reference here's what the modified XML's update section looked like.
<Batch OnError="Continue" PreCalc="TRUE" ListVersion="0">
<Method ID="1" Cmd="Update">
Thank you Lui.
This is very helpful. I also got it working for single user using -1;#loginname
I wonder how to use it for multiple user fields.
The task is to copy an already populated multi user field to another list.
When I read the field I get "display name user1;display name user2"
How could this be translated into [ID];#[Person];#[ID];#[Person];#
Do I need to separate those values using build string or Regular Expressions?
Or is there an easier way.
Does anybody have a suggestion.
I found the following solution:
use Build String action and convert the variable returned from the multi people field (return type: Display Names, Semicolon Delimited):
It adds ";#-1;#" at the beginning and ";#" at the end while the function replaces the ";" separating people with ";#-1;#"
Now it could be used with any number of people.
I tested it successfully with one, two and three people
Thanks again for your help.
Hi, Gerard Rodriguez, Are you able to select a "correct answer" from this thread? If so, it's helpful to the community members seeking answers to similar issues. Thanks!
Your community manager