Append to String Variable
The "Append to string variable" action in Power Automate is used to add more text to an existing string variable without overwriting its current value. Think of it as taking a note and writing extra text at the end rather than starting fresh.
Key Points
Only works on variables of type string.
You cannot use it on uninitialized variables—you need to create a string variable first.
It is useful for building dynamic text, creating logs, or collecting multiple items into a single text value.
Step 1: Initialize the String Variable
Before appending, you need a string variable:
Add Initialize variable action.
Set:
Name:
MyStringType:
StringValue:
"Hello"
Step 2: Append to the String Variable
Add Append to string variable action.
Set:
Name:
MyStringValue:
" World!"
This will add " World!" to the existing "Hello" value.
Step 3: Using the String
You can now use the variable in emails, messages, or logs. For example:
Add Compose action and use
MyString.
Output:
Hello World!
Full Example Flow
Scenario: Collecting names of attendees in a list.
Initialize variable –
Attendees(String) → empty""Apply to each attendee in your list:
Append to string variable → Value:
@{items('Apply_to_each')['Name']},
Compose / Send email →
Attendees
Output might be:
Person1, Person2, Person3,
Scenario: Collect Email Addresses from a SharePoint List
Suppose you have a SharePoint list of employees, and you want to collect all email addresses into a single string separated by commas.
Step 1: Initialize the String Variable
Action: Initialize variable
Name:
AllEmailsType:
StringValue:
""(empty)
Step 2: Get Items from SharePoint
Action: Get items
Site Address: Your SharePoint site
List Name: Employees
This retrieves all employee records.
Step 3: Apply to Each Item
Action: Apply to each → value from Get items
Inside this loop:
Append to string variable
Set:
Name:
AllEmailsValue:
@{items('Apply_to_each')['Email']},
This takes each employee's email and adds it to the AllEmails string, separated by commas.
Step 4: Use the Combined String
Action: Send an email
To:
AllEmails
Result:
If your SharePoint list has these emails:
[email protected]
[email protected]
[email protected]
Then after the flow runs, AllEmails will be:
[email protected], [email protected], [email protected],
You can then use a substring() expression to remove the trailing comma if needed:
substring(variables('AllEmails'), 0, sub(length(variables('AllEmails')), 2))
Tips
Always initialize the variable first.
Use Append when building a single combined string.
Use Set variable if you want to replace the value entirely.
To remove trailing separators (like the last comma), you can use
substring()ortrim()in expressions.
Append to Array Variable
Append to array variable in Microsoft Power Automate is an action used to add a new value or item to an existing array variable during a flow. It helps collect multiple pieces of data into a single list as the workflow runs.
1️⃣ Create the Array Variable First
Before you can append to an array, you must initialize it.
Add action Initialize variable
Configure:
Name:
MyArrayType:
ArrayValue:
[]
2️⃣ Add the Append to Array Variable Action
Click New step
Search for Append to array variable
Configure:
Name:
MyArrayValue: value you want to add
Example:
{
"Name": "John",
"Age": 30
}

Join the conversation! Your thoughts help the community grow.