cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BCBuizer
Super User
Super User

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

 

 

 

 

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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,388)