Skip to main content

I'm trying to add some record IDs to a text variable (collection), and I'm doing something wrong with my loop.  Get Records and the loop iteration seem to be fine, but I'm incorrectly assigning the IDs both ways I've tried to map the elements. 

 

One assigns a single ID and then exits, I get why it does that.  

 

Basic loop, trying to add some IDs to a collection variable

 

The other assigns ID "A", and then IDs "A" and "B", and then "A", "B", "C" and so on. 

 

loop 1.png

 

What can I do to make it add each ID, just once, to my variable, so that I have a text list of IDs that would be substantially the same as what the Get Records returns? 

 

 

 

#Flow

1 answer
  1. Jan 28, 2025, 3:25 AM

    Your assignment element needs to connect back to the loop element, that's the problem with first screenshot. Auto layout is good for this.

    To stop adding duplicate IDs you can include a decision element inside your loop where you check if your text collection contains the current id being iterated on. If yes, then loop through next item, if no then add the id to collection

0/9000