Hi Benjamin,
What you want is possible imo but not that straight forward as using that 'People or Group' field directly in the action.
What you must do is get the id from the users from the field. This are the ID's shown at the end of the string: {"__metadata":{"type":"Collection(Edm.Int32)"}... (you left that part away).
When you have the ID's, you must use, per ID, the 'Call HTTP Web Service' action with the address the REST interface: [WebUrl}/_api/Web/GetUserById($ID). $ID must be replaced with the correct value.
The response content contains the user account (LoginName) which can be subtracted with a bit of XML magic
Below is a part of the response content returned to me:
Now you have the accounts to use in the action 'Office 365 update item permissions'
Cheers and good luck!
Rick
Please mark this reply as a correct answer if it is a solution for your problem.
Works fine, you need to create a collection from the multi-person field and then a loop through that collection and set permissions for each person
Hi Warwick,
This works for on-premise yes, but not for Office 365. Could you please make a workflow for it in Office 365, export it and add it to your comment so I can use it to verify your remark. That sounds indeed much easier if it works. Thanks!
Cheers,
Rick
hmmm.. looking into this I am now very confused.
The above images are of Office 365, I'm picking up a multi person field and added them to the SharePoint Group on a site - and it works
But looking into it I have no idea how, I tried to implement the same solution using the Update Item Permissions action and it didn't work. It looks like the look is actually doing nothing as it can't find any ; any ways.
Hi Beni,
well, the multi-value field is being represented as a JSON disctionary in the workflow, which looks like this:
{"__metadata":{"type":"Collection(Edm.Int32)"},"results":[11,13]}
In order to assign each person permissions, you first have to extract the peoples and then loop over the list like Warwick Ward already showed. So my workflow looks like this:
At first I write the value of the multi-value-person-field into a dictionary called "varDictPersons".
Remember the JSON array above? So next we need the results, which is actually another array. So we want to store the results in a collection, in order to loop over them.
Now that we have a collection, we can just simply iterate over the items and assign them to a variable "varCurrentPerson".
It might be worth mentioning, that "varCurrentPerson" is of type "Person". This way you'll get a valid sharepoint user object, without needing to explicit call any web-service which would turn the user-id into an user-object.
Finally you can assign permissions to this user!
Voila!
Hi Henning Eiben,
I just checked your solution and it works great. It is much less complex than the solution I mentioned.
Cheers,
Rick
Hi Henning,
great! That's the solution. Many thanks :-)
But there is one question left:
How can I update only the current item. Within the "Items to update" section?
I always get an error similar like this one:
"Filter rule error, column '4' does not exist. It may have been deleted by another user"
I tried
- Current Item: ID = Current Item: ID
- using variables for the mapping
- another column which correlates with the id
- Current Item:ID = 4
but it doesn't work.
Any ideas?
So you may not use the "Advanced Lookup" here. You have to type the column name (ID) manually - Wow... That was the problem.Thanks again, Henning :-)