I'm trying to iterate over customobject records where there is Master-Detail lookup to Account Object on this customobject. I'm storing accountId for each customobject record into Collection Variable. But that collection have duplicate values, and I need to get value of those AccountId(No Duplicate) stored in single variable as text.

Here is AccountIds collection variable that stored AccountIDs.

enter image description here

But as you see they have duplicate values in them. and I need to pass this Id's in single variable Text type without duplicate values.

  • you want to convert the collection variable into a scalar variable with duplicates removed - by concatenating the unique values into a single delimited string? I guess I would ask "why"
    – cropredy
    Apr 5, 2020 at 18:33
  • @cropredy I'm using this Ids in other component "LookupFSC" in which i'm doing lookup on Account and for filter I can use variable or formula but it will not accept collection variable. However one small clarification that if Ids are duplicate it won't matter, It just needed to be in ('0011U00000oyv8UQAQ','0011U00000oyv8YQAQ','0011U00000oyv8UQAQ') format. Here is question that will make more sense I guess
    – Watson
    Apr 6, 2020 at 5:02

1 Answer 1


Check out this dedup extension: https://unofficialsf.com/de-dupe-an-sobject-collection-and-schedule-an-email-in-flow/

Once you have your collection of accounts deduped, you can use the Extract Fields from Collection extension to get your list of ID's

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .