cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BCBuizer
Resolver III
Resolver III

Set Variable action appends, rather than sets, string value

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?

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

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

 

 

 

 

View solution in original post

2 REPLIES 2
eric-cheng
Solution Sage
Solution Sage

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

 

 

 

 

View solution in original post

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!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,135)