← Al Davies, 250 High Street

How to join text together in Power Automate

Use the concat() expression. concat('Invoice ', 'INV-', '1042') returns Invoice INV-1042. It accepts two or more text values and returns one combined text value.

How does concat() work?

concat(text1, text2, ...) joins the values in the order you list them and adds nothing between them. concat('Hello', 'World') returns HelloWorld.

Add a Compose action, open the Expression tab and enter the expression. You can drop dynamic content into any argument.

How do you add a space or a separator?

Add the space as its own text argument. concat(triggerOutputs()?['body/FirstName'], ' ', triggerOutputs()?['body/LastName']) returns a full name such as Jane Smith.

The same method works for a comma, a dash or a line break. Each separator is one more quoted argument.

Is there a shorter way than concat()?

Yes. Microsoft documents string interpolation. Write the text as normal and wrap each expression in @{ }. For example, Invoice @{variables('Prefix')}-@{variables('Number')} gives the same result as a concat() call.

Interpolation is easier to read when you build a sentence, such as an email subject. Use concat() when you build the value inside a longer expression.

How do you join a number or a date into text?

Convert the value to text first. Use string() for a number: concat('Total: ', string(variables('Total'))).

For a date, use formatDateTime() so you control the layout: concat('Due ', formatDateTime(utcNow(), 'yyyy-MM-dd')). The guide on formatDateTime and time zones lists the format codes.

How do you join the items of an array?

concat() joins separate values. It does not loop over an array. To turn an array into one text value with a separator, use the Join action or the join() expression.

See the Join action for the steps. If the array holds objects, run a Select action first to pull out the one field you need.

How do you build a text value in a loop?

Create a string variable, then add an Append to string variable action inside the loop. Each pass adds one more piece of text to the end.

For a simple list of values, Select plus Join does the same job with fewer actions and no variable. Compare the options in Compose vs variable.

What if a value is empty?

A column with no value can arrive as null, not text. To be sure each piece is text, wrap it in coalesce(value, '').

The guide on coalesce and default values shows the pattern.

FAQ

How many values can concat() join?

Two or more. You list each value as a separate argument.

Does concat() add a space between values?

No. Add the space yourself as a quoted argument: ' '.

Can concat() join two arrays?

Use union() to combine arrays and remove duplicates. concat() is for text.

Sources