How to use the Join action in Power Automate
Add a Data Operation Join action, put your array in From, and type a separator in Join with. Join returns one text string, such as a list of email addresses separated by semicolons.
What does the Join action do?
Join takes an array and joins its items into a single string. You choose the separator, such as a comma, a semicolon or a line break.
Microsoft gives this example: your flow receives an array of email addresses, but your email program needs one string with semicolons between the addresses. Join makes that string.
How do you add a Join action?
- Select the plus sign (+), search for Join, and pick Join under Data Operation.
- In From, add the array. For a Compose output, select Outputs.
- In Join with, type the separator. Type a semicolon (;) for an email To field.
- Save the flow and run it.
- Open the Join action in run history. The output is one string.
How do you join values from SharePoint rows?
Join works on an array of text. A Get items action returns objects, so Join would print each whole record as raw JSON. Run a Select action first and switch Map to text mode. Map one value, such as the email column.
Then point Join at the Select output. See our guide on the Select action. If Get items shows only 100 rows, see Get items returning only 100 items.
What is the join() expression?
You can write the same thing in an expression: join(body('Select'), ';'). The first argument is the array. The second is the separator.
Use the expression when you need Join inside another action, such as the To field of Send an email. This saves one action in the flow.
How do you put each item on a new line?
For a plain-text body, type a line break in Join with. Press Enter in the box, or use the expression decodeUriComponent('%0A').
For an HTML email, join with <br> instead. A plain line break does not show in HTML. For a full table, see our guide on formatting an HTML table.
Why does Join fail or give the wrong result?
- The output shows raw JSON. From holds objects, not text. Add a Select in text mode first.
- From is a string, not an array. Join needs an array. Use split to make one.
- One item is null. Wrap the field in coalesce() in the Select step.
- The email has a stray space. Add trim() in the Select Map value.
- The output has a trailing separator. Check for an empty last item in the array.
How is Join different from Split?
They are opposites. Join turns an array into a string. Split turns a string into an array.
A common flow uses both. Split a text column on commas, change the items, then Join them back.
FAQ
Can Join work on an array of objects?
It runs, but each item comes out as raw JSON. Run Select in text mode first to get an array of text, then Join.
What separator can I use?
Any text. Common choices are a comma, a semicolon, a space or a line break.
Is Join the same as the join() expression?
Yes. Both take an array and a separator and return one string.