cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

syntax for collection of usernames set item permissions

Hi

Im trying to Set item permissions for an item.

I don't know the usernames until  run time, so I am using a collection variable. in the 'Users' field of the 'Set item permissions'.

 

1) should this rather be a text variable?

2) what should the syntax of the field be?

 

So far I have been able to put the 'Set item permissions' inside a foreach loop (for each user)  this slows down the execution of the processes.

 

Example data:

colUserNames = user1; user2; user3;

 

Thanks

Barry

Labels: (1)
0 Kudos
Reply
5 Replies
fhunth
Nintex Newbie

Re: syntax for collection of usernames set item permissions

You could have a text variable with aliases separated by ; as you mentioned.

0 Kudos
Reply
Not applicable

Re: syntax for collection of usernames set item permissions

Hi Fernando

Thanks for responding.

I have tried a text variable with aliases separated by ; this does not work.

What I find really strange is that if I paste the value of the text string into the field and then save, it resolves ok as expected but at run time it fails to resolve.

0 Kudos
Reply
dan_stoll
Nintex Newbie

Re: syntax for collection of usernames set item permissions

What is the error your getting ? Have you tried just using the Collection Variable as the value for the users ?

0 Kudos
Reply
Not applicable

Re: syntax for collection of usernames set item permissions

Hi Dan

I have tried a collection as well,

The error I get in the logs is

for a string of user1;user2; ( I have replaced actual user namesSmiley Wink )

No user was found with the specified username 'user1'. Permissions have not been set for this principal.

No user was found with the specified username 'user2'. Permissions have not been set for this principal.

0 Kudos
Reply
Not applicable

Re: syntax for collection of usernames set item permissions

I am 99% there,

These two articles are the keys

 

1) coerce the text into a "people or group" using set variable, I then had "user1;user2;" as a plain text coerced into a people text;

see https://sharepointlady.wordpress.com/2011/08/19/workaround-person-or-group-field-one-value-problem-u...

2) the syntax for user1 is different depending on your versions of thing 

see SharePoint REST API: Get User Id by User Name - CodeProject

 

I no longer have to iterate through each individual user.

 

Thanks for all you help

0 Kudos
Reply