function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Krrish GopalKrrish Gopal 

How to create a unique account name collection variable in Salesforce flow?

Hi,
I want to create a unique account(unique account name) collection variable in Salesforce flow using get record element, we have duplicate account name(multiple account with same name) and I want to skip sames name account in my collection variable.

Regards,
Krishan Gopal
Suraj Tripathi 47Suraj Tripathi 47
Hi Krrish,
Greetings!

If you want different name accounts, Please use logic in flow.
Because there is no DISTINCT in the SOQL query.
So please use loops in flow and assign records in a new resource before checking the name contains in the resource.

If you find your Solution then mark this as the best answer. 

Thank you!

Regards,
Suraj Tripathi
Krrish GopalKrrish Gopal
Hi Suraj,
Thanks for your quick response!
Let me explain i have an object vendor cost sheet(custom object) and i wanted to issue bulk purchase order to the vendors(account object lookup at vendor cost sheet)  associted with vendor cost sheet.
I create a flow in which i use get record element to get all the vendot cost sheet records and then I loop thorugh the vendor cost sheet and create a purchase order and then create purchase order line items based on the entries in vendor cost sheet.

Continue in next post
Krrish GopalKrrish Gopal
User-added image
 Continue in next post
Krrish GopalKrrish Gopal
User-added image
Krrish GopalKrrish Gopal
User-added image
Krrish GopalKrrish Gopal
As you can see in the above screen shot PO#1 and PO#2 are duplicate purchase order to one of the vendor Real Time - Chennai, I want to skip that dulicate vendors before loop display vendor in my flow. Kindly suggest how to do that.