If you want to concatenate multiple strings within a Microsoft flow, use the Power Automate Concat Function. Just list all strings you need to append comma separated in a Power Automate Concat expression.
In this article, the Concat function is introduced and a step-by-step guide demonstrates its usage.
The article ends with solution for common problems.
Power Automate Concat Function
The Power Automate Concat function appends multiple strings to each other.
Syntax
concat('<text1>', '<text2>', ...)
Input parameters
- text1(mandatory): At minimum you have to provide on string to concat.
- text2, text3, .. (optional): One or multiple strings to concatenate. The function expects a comma separated list of string and integer parameters.
Return value
- The resulting concatenated string.
Power Automate Concat Example
concat('johannes', '@', 'zeitgeistcode','.','com')
=> [email protected]
How To Concat Strings in Power Automate Microsoft Flow
In this simple example, we define a variable with value ‘Hello’ and use the concat function to append the string ‘joe’.
-
Create a new flow with trigger ‘Manually trigger a flow’
New flow
-
Click on ‘+ New step’
Add a ‘+ New step’
-
Search for ‘initialize’ and click on ‘Initialize variable’
Add Initialize variable
-
Setup Initialize variable: Name ‘hello’, Type ‘String’ and Value ‘Hello’
Setup Initialize variable
-
Add Compose step
Compose
-
Set Compose Inputs to: concat(variables(‘hello’),’ ‘,’joe’)
Power Automate Concat expression
-
Do a test run
Result test run
In case you want to copy & paste the Power Automate concat expression:
concat(variables('hello'),' ','joe')
Power Automate Concatenate Strings Examples
How to concat an array?
To concat elements of an array, the concat function won’t work. Use the join function instead:
join(variables('myVar'),'')
How to concat new line to a text?
You need to append a line break? Use the decodeUriComponent function like this:
concat('line 1',decodeUriComponent('%0A'),'line 2')
=>
line 1
line 2
How to concat a single quote?
You need to append a single quote? Use the decodeUriComponent function like this:
concat(decodeUriComponent('%27'),'hello',decodeUriComponent('%27'))
=> 'hello'