Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SP0+LcQrcYjYtF9JNMokaL
Power Automate - Building Flows
Unanswered

Array Variable / Append to Array Variable / Multiple Select SharePoint List People Column

Like (1) ShareShare
ReportReport
Posted on 12 Jul 2024 19:13:34 by 25

Hi all,

 

I have a bit of an issue with a flow I'm building to create outlook events that we can later follow up on and log whether they were successful and add notes and whatnot.

 

Everything to create the item is working well, but the problem is on my update list item step at the end where I am adding the outlook event ID in case the event needs to be altered that could still be done from the list using the ID to find it.

 

I have a people picker column that allows people only / multiple selections for selecting trainees. Each trainee gets added to the invite and their manager is pulled and added as optional to the invite to keep them apprised of the situation.

On my update list item action, I have to add the value for for these trainees because I have the field as required. I am initializing an array variable an applying to each appending the user claims variable. Upon completion, I see outputs in the flow report, but the field gets cleared out in my list.

I have this same solution in place elsewhere but not for a people picker, just a regular multi-select choice column, and those work fine, so I'm wondering if anyone has any ideas. I have tried claims and I have tried the email value in the variable, but same issue persists.

 

Thank you for your time.

 

traineeVariableFlow.jpgtraineeVariableOutputs.jpg

  • LoufromNH Profile Picture
    25 on 15 Jul 2024 at 16:19:22
    Re: Array Variable / Append to Array Variable / Multiple Select SharePoint List People Column

    I will give this a try and let you know.

     

    Thank you for the detailed help.

  • creativeopinion Profile Picture
    10,406 Super User 2025 Season 1 on 12 Jul 2024 at 21:52:31
    Re: Array Variable / Append to Array Variable / Multiple Select SharePoint List People Column

    @LoufromNH 

    Create a Dynamic Content Key

    Instead of the Switch function I'd recommend creating a JSON object instead and using an expression. I would recommend creating a new flow for you to test out the concept first before adding it to your current flow. I demo this concept in this section of one of my tutorials.

     

    Add a Compose action with your dynamic content key. Insert opening and closing curly brackets. Between the curly brackets enter a line for each content pair. 

     

    In your case, the location would be on the left (before the colon) and the email address(es) would be on the right. If you have multiple email addresses ensure you have a semi-colon separating each. 

    {

    "Location 1": "email1@email.com;email2@email.com"

    }

     

    There should be a comma after each line except for the last line.

    creativeopinion_14-1720819010398.png

     

    Add another Compose action to store a testing value (aka Location in your case). Tip: Always rename your actions especially if you have multiple instances of the same action in your flow. It'll help to keep things organized.

     

    This Compose action is optional, you can insert the value right into the expression. However to help you better understand what's going on, I recommend you use a Compose action. You will replace this with dynamic content from your actual flow. Keep in mind this value must match the text exactly as you have it in your key. Enter any value for testing purposes.

    creativeopinion_16-1720819032152.png

     

    Add one more Compose action to store an expression. Insert a question mark and square brackets.

    creativeopinion_7-1720818381569.png

    In between the square brackets insert the output from the Compose action above.

     

    creativeopinion_8-1720818403098.png

    Go to the start of the expression by pressing the up arrow key. Insert the output from the Compose action with the JSON object.

     

    creativeopinion_9-1720818422810.png

    This expression will output the value on the depending on what value is inserted into the square brackets of the expression.

    creativeopinion_10-1720818446699.png

    Run a test. Review the outputs. You can adjust the value in the Compose action to another value and run another test. Ensure the output is what you are expecting.

    creativeopinion_11-1720818476579.png

    You can copy these actions int your current flow and insert the appropriate dynamic content (location value in your case) into the Compose action that is holding the value.

    creativeopinion_12-1720818547238.png

     

    ----

    Array Variables

    It's unclear to me the reason you have initialized these two variables:

    creativeopinion_17-1720819555765.png

    When updating a multi-choice person column. The array structure that is expected is 

     

    [

    {

    "Claims": "emailaddress1@email.com"

    },
    {

    "Claims": "emailaddress2@email.com"

    }

    ]

    If the Trainee's dynamic content is a multi-person field, you can use a Select action. In the From field, insert the multi-person dynamic content. 

     

    In the Key field, enter the word Claims. In the second value field insert the multi-person email dynamic content.

    creativeopinion_19-1720819813050.png

     

    Run a test. This is what the output should look like.

    creativeopinion_20-1720819849259.png

    You can take the output from the Select action and insert it into the multi-person column field of your Update Item action.

    creativeopinion_21-1720819894807.png

     

    Get the Managers

    The Select action outputs an array. You can use the output of the Select action in an Apply to Each action. The Compose action is optional, however it can help with troubleshooting. I'm using it to output the current email being looped through.

     

    You'll need to insert an expression:

    item()?['Claims']

    creativeopinion_25-1720820455019.png

     

    Insert the Get manager (V2) action.

    creativeopinion_23-1720820122368.png

    Add an Append to Variable action to collect the display name and email address of each manager. The format is the same as the JSON object.

    creativeopinion_30-1720820770179.png

     

    Add a Compose action outside of the Apply to Each action to output the variable.

    creativeopinion_26-1720820516784.png

    Run a test. Review the outputs.

    creativeopinion_31-1720820809736.png

     

    creativeopinion_32-1720820822817.png

    Use a Select action to collect the Email Addresses only. In the Fro field, insert the output from the Compose action above (or the variable).

    Insert an expression.

    item()?['Dynamic Content Key']

    Replace the text in blue with the appropriate key. In this case, Email.  You'll need to repeat this for the Display Name.

    creativeopinion_33-1720820842749.png

    Insert a Compose action and use the join() function to convert the email from an array to a string.

     

    creativeopinion_34-1720820882317.png

    Run a test. Review the outputs.

    creativeopinion_35-1720820953651.png

     

    Scope Action

    I would recommend adding Scope actions to your flow to keep it organized. The Scope action is optional however you can quickly collapse multiple actions with a single click.

     

    creativeopinion_36-1720820992975.png

    creativeopinion_37-1720821002695.png

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

  • LoufromNH Profile Picture
    25 on 12 Jul 2024 at 20:07:13
    Re: Array Variable / Append to Array Variable / Multiple Select SharePoint List People Column

    Hello,

     

    The following are seperate pictures, but they are in order. Nothing is missing except a few more Switch options off to the sides, but they just take the value of the list dropdown for room name and append a variable with the room email so I can use it to book the room.

     

    But, there are no errors to show, unfortunately:

    flow01.jpgflow02.jpgflow03.jpgflow04.jpg

    Thank you for looking.

  • creativeopinion Profile Picture
    10,406 Super User 2025 Season 1 on 12 Jul 2024 at 19:58:37
    Re: Array Variable / Append to Array Variable / Multiple Select SharePoint List People Column

    @LoufromNH It would provide more insight if you could click on all actions to expand them. It's hard to understand the logic when the actions aren't expanded.

  • LoufromNH Profile Picture
    25 on 12 Jul 2024 at 19:53:46
    Re: Array Variable / Append to Array Variable / Multiple Select SharePoint List People Column

    Hello, I will attach a few photos. The thing is I'm not getting any errors. I was but I've cleared them and now am observing this strange behavior. My thinking is that the values aren't validating for the people picker column so they end up just not saving, but since an overwrite was attempted the old values aren't available anymore either.

    LoufromNH_0-1720813834448.png

    LoufromNH_1-1720814013021.png

     

     

  • creativeopinion Profile Picture
    10,406 Super User 2025 Season 1 on 12 Jul 2024 at 19:37:01
    Re: Array Variable / Append to Array Variable / Multiple Select SharePoint List People Column

    @LoufromNH It's hard to offer any recommendations without seeing how your flow is laid out. Upload a screenshot of your flow in edit mode and the error you are receiving, it would help to provide more insight.

     

    In the meantime, you might be interested in this YT Tutorial:

     

    How to Handle Multi-Person SharePoint Item Notifications in Outlook and MS Teams with Power Automate

    Do you want to know how to send an email to all users assigned to a SharePoint item? If so—this Power Automate tutorial is for YOU 🫵.

     

    In a different YouTube tutorial I covered how to build a Power Automate flow that sends a single email to each user with the tasks assigned to them.

     

    However, that tutorial only covered a scenario where each task is assigned to a single user. What if your task is assigned to more than one user?

     

    In this Microsoft Power Automate tutorial I’ll cover how to create a flow that is triggered by selecting an item. This automation will send an email to all assigned users for the selected task. I’ll also show you how to adjust your flow so that you can send a message in Teams. Then I’ll show you how to collect a list of unique users that have been assigned to multi-person tasks. Using this concept, we’ll edit the flow from the previous tutorial so that it works with a multi-person column.

     

    IN THIS VIDEO:

    âś…  How to trigger a flow from a selected file

    âś…  How the multi-person column data outputs

    âś…  How to use the Select action to get all assigned to users of a SharePoint item

    âś…  How to use the Join action to convert an array of email addresses into a string

    âś…  How to send a single email to all assigned to users of a SharePoint item

    âś…  How to send an email to each assigned to user of a SharePoint item

    âś…  How to send a Teams message to each user assigned to a SharePoint item

    âś…  How to return a list of unique users from the multi-person column in a SharePoint list

    âś…  How to use a Filter Array action to return all SharePoint list items assigned to each user

    âś…  How to group Power Automate actions together with the Scope action

    âś…  How to edit a previous flow

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 55

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 39 Super User 2025 Season 1

#3
VictorIvanidze Profile Picture

VictorIvanidze 26

Overall leaderboard