Power Automate: Populate SPO User Claims (multiple claims)


Power Automate can add user accounts to SharePoint Online list items. If the person column accepts a single account, then the assignee claims are passed as a string. But for multiple accounts, the assignee claims are passed as an array.

Illustrating this, loop through a list of approvers, then add them all to a list item…

Figure 1 – List of approvers in SharePoint Online list.

Regardless of the trigger, the workflow should have 1 object variable and 1 array variable. Next, get the list of approvers:

Figure 2 – Power Automate workflow variables.

As the list of approvers are enumerated, there are a few actions nested within the for-each loop:

  • Set the current item to the object variable,
  • Compose/ build the claims object, then
  • Append the compose action output to the array variable:
Figure 3 – Power Automate workflow loop logic.

Within the compose action, the claims object is constructed as a key-value pair. This populates the claims of the current enumeration item…

Figure 4 – Power Automate compose action for user claims.

The compose action of Figure 4 formats the user claims from the tempObj variable:

variables('tempObj')['Approver']['Claims']

Lastly, with the array constructed, create a new SPO list item. Note, the person column will need to be switched before it can accept the array variable.

Figure 5 – Power Automate workflow action assigning claims array.

After a successful run, the flow output will show the claims as an array of objects!

Figure 6 – Power Automate workflow output of claims array.

Finally, open the SPO list and review the new item with the multiple accounts assigned:

Figure 7 – SharePoint Online successful list item creation.

Conclusion:
Assigning multiple accounts to a list item isn’t impossible, but just requires a few extra steps. Yet, still an easy-ish thing to configure…

“Take a stand for what’s right. Raise a ruckus and make a change. You may not always be popular, but you’ll be part of something larger and bigger and greater than yourself. Besides, making history is extremely cool.”

Samuel L. Jackson

#BlackLivesMatter

2 thoughts on “Power Automate: Populate SPO User Claims (multiple claims)

  1. Hi Charles,
    Thank you so much for this solution! I’m not 100% where I’m going wrong, but after ‘compose’ and ‘append to array variable’ mine adds slashes to the Claims item. Any ideas? The output on the test reads: [
    “{\”Claims\”:\”i:0#.f|membership|yresto@*****\”}”
    ] and then gives me a bad gateway error. I’m almost sure it’s because of those slashes.

    Like

Leave a reply to Charles Cancel reply