Are you need to use Append to string variable action in Power Automate? Then this Power Automate tutorial will show how to use append to string variable action in Power Automate. I will show how to append text onto an existing text string in flow.
I am in need to append the Last Name with the First Name. And I have successfully appended the values. If you also want to append values or work with Append to string variable action. Follow the below steps; surely, it will also work for you.
How to use append to string variable action in Power Automate
Let us see how to use append to string variable action in Power Automate.
Example-1:
The flow will trigger manually and requests the user to enter a First Name and Last Name value in a textbox. Then, we initialize a string variable to store the first name; using the Append to string variable action, we will append the last name with the first name and display the result in compose data operation.
Follow the below steps to achieve this:
Step-1: Log in to Power Automate flow using Microsoft credentials, Create an instant cloud flow, and add a text input value for First Name and Last Name like below:
Step-2: Choose an initialize variable action to initialize the variable in a string format. Enter the Variable name and choose the Variable type as String. Pass the First Name from the dynamic content value in the value section.
Step-3: Select +new step and choose append to string variable action; from the dropdown, select the initialized variable, and in the value section, pass the Last Name from the dynamic content value.
Step-4: Add a compose data operation and pass the initialized variable that consists of the First name and the appended last name value.
Step-5: Save and Run the flow. Enter the First Name and Last Name and click on the run flow option.
Once the flow runs successfully, we can see that the last name value is appended with the first name by using the append to string variable action. We can see the expected output in the compose data operation.
This is how to append text onto an existing text string using the append to string variable action in Power Automate flow.
Example-2:
Here we will see how to append string value dynamically in Power Automate.
The flow will trigger manually and gets all items from the SharePoint list. Then, we initialize a string variable with an empty value, by using the Append to string variable action, we will append the Product Names and displays the output in compose data operation.
In this example, we will use the below displayed Product SharePoint List:
- Product Name – default title column
- ProductQuantity and ProductPrice – Number column
Step-1:
Create an instant cloud flow. Select +new step and add Get items action from the action triggers. Configure the SharePoint site address and list name. Here I have selected my SharePoint and list name called Products.
Step-2:
- Choose an initialize variable action to initialize the variable in a string format. Enter the Variable name and choose the Variable type as String. Leave the value section empty.
Step-3:
- Select +new step and choose append to string variable action; from the dropdown, select the initialized variable.
- Pass the Title (ProductName column) in the value section from the dynamic content value.
- It will automatically add, apply to each control loop, to loop through all the items presented in the SharePoint list.
Add a compose data operation and pass the initialized variable with Product Names.
Step-4:
- Save and Run the flow. Once the flow runs successfully, we can see it appends all the Product Names from the SharePoint list to the initialized string variable by using the append to string action.
- And displays the expected output in the compose data operation.
This is how to append string values dynamically in Power Automate.
Conclusion
In this tutorial, I have explained how to append text onto an existing text string by using Append to string Variable action in Power Automate flow with different examples.
You may like the following tutorials:
- Convert time zone in Power Automate
- Convert Float to Integer in Power Automate
- How to count rows in an Excel table using Power Automate?
- Move files from one folder to another using Power Automate
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.