In this Microsoft Power Automate tutorial, we will discuss how to concatenate strings in Power Automate or Microsoft flow. Also, we will discuss the below examples:
- Power Automate Concatenate String
- Power Automate concatenate a variable with string
- Power Automate conactenate a string with string
- Power Automate concatenate a string with number
- Power Automate concatenate a string with date
Power Automate Concatenate String
In Power Automate we can concatenate strings by using the string concat() function.
There is a string function named Concat() that combines any number of strings together. The syntax for this function is:
We will see this implementation in an example in Power Automate or Microsoft Flow.
If you are new to Power Automate, check out, Leave Request Approval Flow using Power Automate or Microsoft Flow
Example-1: Concat variable with string
Let’s have a look at the below example, where we will use this concat() function. For this, on Power Automate, first, we will trigger our flow manually by adding Trigger flow manually from the instant cloud flow.
Then we will add an action to Initialize the variable. Here we will give a name to our variable, set the type as a string, and value as triggered user name(it will show the user name who triggered the flow).
Then we will add a Compose action where we will insert an expression that will be concatenating the user name with a string. The expression is:
concat('Have a Good day',' ',variables('VarString'))
Similarly, we can use any string value instead of the text i.e. have a good day. For space here we use a ‘ ‘. Now our flow is ready. So just save and test the flow. The output will come like below:
As the user name is Sonam Subhadarsini so it came like this. This is how we can concatenate the strings with variable on Power Automate.
You can download this flow from here.
Example-2: Concat a string with another string(single line text)
In this example, we will see how to concatenate a string with another string. For example, we have a sharePoint list based on employee details having columns such as First name and last name (single-line text), Dept(choice field), joining date(date/time field).
But as per our requirement, when we will insert the employee’s data on a SharePoint list it will combine the first name and last name into full name and notify the Manager.
For this, we have discussed here the steps:
On Power Automate, we will add a trigger “When an item is created“.On that we have to insert our SharePoint site address and the list name that we will use.
Then we will add a Compose action, in that we will insert an expression that will perform the concatenation with two strings. The expression is:
Now we will add an action “Send an email“, which will notify the manager when a new employee details are created on the SharePoint list with the full name.
Now our flow is ready to run. So just save it and test it manually. When we enter first name and last name on SharePoint list:
But we can see it will contact the first name and last name on the mail:
This is how to do concatenate two strings from SharePoint list on Microsoft flow. You can download this flow from here.
Example-3: Concatenate a string with a number
In this example, we will see how to concat a string with a number on Power Automate.
For this, we will add a trigger that will trigger the flow manually. On that trigger, we will use text input and number input.
Then we will add a Compose action that will concate the text with number by using an expression.
When we save & test the flow manually, it will ask to enter the text and number and click on Run flow.
Now we can see the output is coming as a string with numbers by concatenating.
This is how we can concatenate a string with Number on Power Automate flow.
Example-4: Concate a string with date
Similarly, we will use a date as an input type on Manually trigger flow. Then we will add a Compose action that will concatenate a string with a date by using an expression:
Now the flow is ready to run. Let’s insert a text and date value to check the output:
Now we can see the output is coming by concatenating the string with date:
This is how to do Power automate concat a string with a number.
Related Power Automate tutorials:
- Power Automate Delete all items in SharePoint list
- PowerApps upload file to SharePoint document library
- Save my email attachments to a SharePoint document library Power Automate or Flow
- Microsoft flow copy list items to another list
- An entry without a type name was found, but no expected type was specified error in Microsoft Flow
- Power Automate convert time zone
- Power Automate vs UiPath
- Power Automate SharePoint Get items filter query contains is not valid
- Power Automate Increment Variable
- Power Automate add days to date
- Power Automate dynamic content
From this Power Automate Tutorial, we learned all about concatenate function on Power Automate. Also, we discussed all:
- How to concatenate a string with variable on Power Automate?
- How to concatenate a string with another string from SharePoint list?
- How to concatenate a string with date on Microsoft flow?
- How to concatenate a string with a number on Power Automate?
I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com