web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Set Variable action ap...
Power Automate
Answered

Set Variable action appends, rather than sets, string value

(0) ShareShare
ReportReport
Posted on by 22,844 Super User 2026 Season 2

Hi Everybody,

 

I have a destination list that receives items from several source lists using PA. Since those flows can't remove items in the destination list when they are deleted in the source list, I was thinking to build a scheduled flow that checks if the items in the destination list still have a corresponding item in the source list: 

BCBuizer_0-1634153406127.png

This flow loops through all of the items in the destination list sets three variables to retrieve the corresponding item from the sources list:

varSourceSite: string type, set in the switch using "set variable" action where the values are hardcoded

varSourceList: string type, set in the switch using "set variable" action where the values are hardcoded

varSourceID: integer type, as in the image using "set variable" action (converts Identifier to ID)

 

In the first loop all is working well, but from the second loop things are not going as expected. For the varSourceSite and varSourceList, the values are appending rather than replaced, so if the value was "ListA" on the first loop, it will look like "ListAListB" on the second where I would expect it to be "ListB". This continue in the third loop until finally the flow errors out.

 

Anybody have any ideas if I'm doing anything wrong or how to work around this?

Categories:
I have the same question (0)
  • Verified answer
    eric-cheng Profile Picture
    5,171 on at

    Hi @BCBuizer ,

     

    Can you post a screenshot of the switch or where it sets varSourceSite and varSourceList?  

     

    Also, can you make sure have used Set Variable instead of Append to String Variable as they both have similar inputs.   I recommend deleting and re-adding the Set Variable action back in.

     

    ericcheng_0-1634172723610.png

     

    Lastly, you could always clear the variable at the end of each loop but its always better to find and fix the problem.

    ericcheng_1-1634172914423.png

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

     

     

     

  • BCBuizer Profile Picture
    22,844 Super User 2026 Season 2 on at

    I was more than convinced I used "set variable" rather than "append to string variable", but I deleted and replaced the actions in the switch anyhow to rule this out. And now the flow is working :S 

     

    Thanks though!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 248 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 160 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 142 Super User 2026 Season 2

Last 30 days Overall leaderboard