Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Solution
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to convert array to a string in Power Automate

Posted on January 31, 2021March 13, 2022 by Tom

“I have a SharePoint column with multiple choices enabled, how can I convert the data from it (array) into a string to send it in a single email in Power Automate?”


Power Automate will automatically add ‘Apply to each’ once you try to use dynamic content from an array. It’s fine if you want to process the items one by one, e.g. update multiple items or send multiple emails. But it’s not so good if you need all the items at once. If you’ve got a SharePoint column with multiple choices, you don’t want to loop through them. You want all of the choices at once, a single string in readable format. It can be user information (emails, names), choices, lookups… The usage is the same: don’t loop, convert the values to a single string.

Simple array

If it’s a simple array with a list of values (no object structure), you can use the join(…) expression. You can see an example of simple array below (created when exporting multiple Person or Group column to .csv):

[
    "xxx@tomriha.com",
    "yyy@tomriha.com"
]

The join(…) expression expects 2 parameters, the array with values, and a separator for the outcome.

join([array], '[separator]')

The example below will take the array (variable var_array), and convert into a comma separated string.

join(variables('var_array'), ', ')

Notes:
variables('var_array') is the array
', ' is definition of the separator, separator are the characters between ' and '

result:
xxx@tomriha.com, yyy@tomriha.com
Power Automate join array into string

Array with objects

It gets a bit more complicated with more complex arrays: Person or Group column, choice column, etc. Instead of just a list of values, complex arrays contain objects with multiple pairs of “key”: “value”.

"Person_MultipleSelection": [
    {
        "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        "Claims": "i:0#.f|membership|xxx@tomriha.com",
        "DisplayName": "Tomáš Říha",
        "Email": "xxx@tomriha.com",
        "Picture": "..."
    },
    {
        "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        "Claims": "i:0#.f|membership|yyy@tomriha.com",
        "DisplayName": "yyy@tomriha.com",
        "Email": "yyy@tomriha.com",
        "Picture": "..."
    }
]

Join(…) expression won’t work here as it would create a string from the whole objects. And you don’t want the whole object, you want just a specific value from that array, e.g. Email.

‘Select’ the values

The best approach is to use the ‘Select’ action. The action expects an array of objects on the input, e.g. the array with multiple users, and allows you to select only some values from it. Put the array as the input, in this example it’s the ‘Person_MultipleSelection’ dynamic content. Since you want to build a string only from the values, you should ignore the key/value mapping and switch to the text mode. That way you can skip the key and select only the values.

Power Automate 'Select' text editor

Each object in the array is represented by the expression item(), and each value by adding ?[‘Key’]. You can use any ‘Key’ from the object. The expressions below will give you all display names or emails of the users.

item()?['DisplayName']
or
item()?['Email']
PA select

Output of the ‘Select’ action will be a new array, this time a simple one, that will contain only the desired values.

PA select outputs

And as was already explained, a simple array can be converted into a string with the join(…) expression

join(body('Select'),';')
->
xxx@tomriha.com;no-reply@tomriha.com
Power Automate convert array of objects into string

Summary

When you convert an array into a string in Power Automate, the first thing to consider is: “what type of array do I need to process”? If it’s a simple array, you can use the join(…) expression. But if it’s a complex array with objects, it’ll require a ‘Select’ action first.

It’s possible to process complex arrays in a single action with a combination of expressions (as when exporting to .csv), but I believe this step-by-step approach has it’s benefits. You can track what’s happening in each step, it’s easier to debug, and much easier to explain and understand.


🚀 Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

15 thoughts on “How to convert array to a string in Power Automate”

  1. Fernando says:
    June 9, 2021 at 12:17 am

    Hi
    I’m stuck on the select values for complex arrays. I may be doing something wrong as after switching to text it doesn’t accept the expression item()?… any suggestion? Can you elaborate a bit more on that step?

    Thanks a lot

    Reply
  2. Fernando says:
    June 9, 2021 at 9:52 am

    All sorted

    Reply
  3. Rafa says:
    September 8, 2021 at 5:52 pm

    Muchas gracias desde Mexico!

    Reply
  4. KB_1234 says:
    January 27, 2022 at 9:25 pm

    I’m having an issue with multiple selections when using this flow. It works fine with one person, but when I add additional people it fails.
    “The specified user Name1, Name;Name2, Name could not be found.”
    Any suggestions?

    Reply
    1. Tom says:
      January 29, 2022 at 7:14 pm

      Hello Kara,
      it seems you’re using the string in an action that allows for only a single value. In such situations you must loop through the array and input the values one by one.

      Reply
  5. Rob D says:
    February 17, 2022 at 5:56 pm

    I’m after a path to a sharepoint library (which can change), I thought I’d use List Folder > Filter Array > Select. Which gives me a one item array. I should then use Join to turn it into a string? I guess my problem is I don’t actually have anything to join or a separator?

    I think I’m over complicating things. Any help is appreciated.

    This is a great site, thank you very much.

    Reply
    1. Rob D says:
      February 17, 2022 at 6:16 pm

      I guess I just needed the Rubber Duck to talk it out with:
      Used Filter>Select>Compose with join(body(‘Select’),”) which seems to give me what I needed. In any case, wouldn’t have gotten there without this site. Thanks!

      Reply
  6. LinC says:
    May 19, 2022 at 8:18 pm

    Hi Tom – Thanks a ton for this post. I’ve been spending sooo much time appending to array/string variables and I knew there had to be a better way. Your explanation is crystal clear and actually makes it look so simple that now I feel embarrassed not to have worked it out sooner…

    THANK YOU! 🙂

    Reply
  7. Leah says:
    June 29, 2022 at 3:21 pm

    I’m also not sure if Join is working correctly to where a string is outputted. As mentioned, I used a semicolon as the separator parameter, but the output shows a comma separator. For your awareness, the Join output looks just like the output of the previous step where I used Select due to a complex array. Example of the output of Join (notice the comma separator is shown):

    [“Email 1” , “Email 2”]

    Reply
    1. Tom says:
      July 6, 2022 at 6:50 pm

      Hello Leah,
      your output is an array (the opening and closing [ ] ), it’s not a string. I’d double check the dynamic content that you apply the join(…) to.

      Reply
  8. Frank says:
    September 16, 2022 at 1:44 pm

    Excellent 🙂

    Reply
  9. Stuart Harrod says:
    October 14, 2022 at 8:32 pm

    Yes, this is a great and straightforward solution. Thank you

    Reply
  10. Carl Williams says:
    December 8, 2022 at 12:37 am

    WOW, this is exactly what I was looking for!!!! Even for the emails. Thanks-you so much!

    Reply
  11. Richard says:
    May 10, 2023 at 6:15 pm

    This helped me out a lot!

    Reply
  12. Pingback: Get items per user in multiple people picker field (Power Automate)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

🚀 Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundle—everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes