How to Use Append to String Variable Action in Power Automate?

One of my team members recently asked If you could add this value to a string in Power Automate. I replied, Yes, first you need to initialize the variable and then use the Set variable action. But they clarified, No, I want to add value at different times. If I use the Set variable action, the previous value is removed, and the new value replaces it.

In this case, I explained that you use the Append to string variable action. This action allows you to add new values to a string without replacing the existing content.

In this tutorial, I will cover how to use Append to string variable action in Power Automate. This action lets you dynamically add content to an existing string variable, which helps build messages, create reports or format data.

Power Automate Append to string variable Action

The Append to string variable action in Power Automate, available in the Variables connector, allows you to add (or ‘append’) text to an existing string variable. It is commonly used to dynamically build strings, such as creating a list of values, formatting data, or generating messages.

In Power Automate, before we use the “Append to string variable” action, we must first use the “Initialize Variable” action. Initialize Variable action creates the variable and Sets the variable type to String.

Power Automate Append to string variable action accepts Parameters:

  • Name: This parameter specifies the string variable’s name to which the value will be appended. You must have already initialized this variable earlier in your flow using the “Initialize variable” action. The name of the variable (selected from the dropdown list of available variables).
  • Value: This parameter defines the text or dynamic content to append to the selected string variable. It can be:
    • A static string (“Item processed.”).
    • Dynamic content (A value from a SharePoint list, Excel row, or form response).
    • A combination of both ( “Task: ” + [Task Name] + ” is completed.”).
power automate append to string variable

Append to string variable Action in Power Automate

Suppose you want to manually create a Power Automate flow to collect a person’s first and last name. The flow will concatenate these two inputs (with a space in between) to generate a full name and then display the result using a Compose action.

To do this, follow the below steps:

1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

Next, we will add a text input for First Name and Last Name:

Append to string variable Action in Power Automate

2. Add an Initialize variable action to set up the variable in string format. Enter the variable name, select the variable type as String, and provide the First Name from the dynamic content in the value field.

@{triggerBody()?['text']}
How to use Append to string variable Action in Power Automate

3. Add the Append to string variable action and provide the below parameters:

  • Name: Select varName from the dropdown.
  • Value: Provide a space, then add the last name from the dynamic content:
 @{triggerBody()?['text_1']}
Append to string variable Action using Power Automate

4. Add a Compose action and provide the above variable from dynamic content to display the concatenated full name:

@{variables('varName')}
Power Automate Append to string variable Action

Save and Test the flow. Enter the First Name and Last Name then click on the Run flow:

How to use Append to string variable Action using Power Automate

Once the flow runs successfully, click the Compose action. You will see that the last name value has been appended to the first name using the Append to string variable action.

use Append to string variable Action in Power Automate

Append to string variable Action in SharePoint List using Power Automate

Suppose you have a SharePoint list named Task Tracker with the below columns:

ColumnsData Types
Task IDSingle line of text
Task NameSingle line of text
Assigned ToPerson or Group
Task StatusChoice
Append to string variable Action in SharePoint List using Power Automate

I want to create a flow that generates a summary of all tasks marked as Completed and sends it as an email.

Follow the below steps:

1. In the Power Automate, click the Scheduled Cloud flow, enter the Flow name, and provide the following:

  • Starting: Provide the date you want to run your flow, like 1st December.
  • at: Provide the time you want to run the flow, like 10:00 AM.
  • Repeat every: I want to run the flow every Friday, so click 1 Week.
  • On these days: Select Friday.
Append to string variable Action in SharePoint List in Power Automate

2. Add the Initialize variable action and provide the below parameters:

  • Name: Provide as “Task Summary.”
  • Type: Select String from the drop-down.
  • Value: leave it blank.
append to string variable power automate

3. Add the Get items action to retrieve all items from the SharePoint list and provide below parameters:

  • Site Address: Select your SharePoint site from the drop-down or provide the URL.
  • List Name: Choose your Task Tracker list from the drop-down.
power automate append to string

4. Add a Filter array action to filter the tasks with Completed status. In the From field, select the value from the Get items action (this will be body/value). Set the Condition as:

Status (the name of the column containing task status) is equal to “Completed”.

power automate append to variable

5. Add an Apply to each action to loop through the filtered array of tasks. In the Select an output from previous steps field, select the value from the Filter array action.

power automate append string

6. Inside the loop, add the Append to string variable action and provide below parameters:

  • Name: Select Task Summary.
  • Value: Provide the below-formatted message:
Task: @{item()?['TaskName']} - Assigned To: @{item()?['AssignedTo/DisplayName']}
How to use Append to string variable Action in SharePoint List using Power Automate

7. After the loop, add the Send an email (V2) action and provide the below parameters:

  • To: Enter the recipient email addresses (e.g., your team members).
  • Subject: Set the subject to “Weekly Completed Tasks Report.”
  • Body: In the body, use the following text:
Hello,

Here is the summary of completed tasks for this week:

@{variables('Task Summary')}

Regards,
Your Automation Bot
use Append to string variable Action in SharePoint List using Power Automate

Save the flow and test it by either running it manually. After the flow runs successfully, check the email.

How to use Append to string variable Action in SharePoint List in Power Automate

Conclusion

In this tutorial, we covered how to use Power Automate’s Append to string variable action to build a dynamic string by appending values. We started by creating a flow that generates a summary of tasks marked as Completed in a SharePoint list. The process included initializing a string variable, retrieving data from the SharePoint list, filtering completed tasks, and appending task details to the variable. Finally, we sent the compiled summary via email.

You may also like:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…