Flows, screen component to mulit-select contacts from account - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Daniel WretmanDaniel Wretman 

Flows, screen component to mulit-select contacts from account

Hi

I am trying to set up a screen flow that will grab contacts from an account, the contacts should be selected using a multiselect screen component, then send this to a loop and forward emails to the selected contacts. The solution I have made work fine if I select just one contact but if I select two or more I get an error. 

"Error Occurred: This error occurred when the flow tried to look up records: Id, Email FROM Contact WHERE ((Id = '0031X00000U2205QAB; 0031X00000U231AQAR')) ^ ERROR at Row:1:Column:39 invalid ID field: 0031X00000U2205QAB; 0031X00000U231AQAR. You can look up ExceptionCode values in the SOAP API Developer Guide."

So I interpret this as the contact ID is sent as a text string to the loop component, if several are sent they are just separated by a ; char. Apparantly the loop can't deal with this. I have tried to use a Get Records element to fetch each contact again using the Id but this seem not to work as I thought. 

Does anyone of you have any idea on how to fetch multiple contacts from a screen element and process them in a loop?
Om PrakashOm Prakash
Hi Daniel,
As per the latest comment from below open idea,
UnofficialSF.com now has a Flow Action called FilterCollection (https://unofficialsf.com/easy-in-filters-in-flow-with-the-filter-query-flow-action/) that delivers a lot of the impact of the IN Operator. It's not a substitute for a native IN Operator solution, but it is a substantial improvement on traditional workarounds. It might be useful to some of the posters on this page.

Please give it a try.


There is an idea for Flow: Support equivalent of SOQL "IN" condition in Record Filters
https://trailblazer.salesforce.com/ideaView?id=08730000000DlzeAAC
Om PrakashOm Prakash
Hi Daniel,
Have you tried the above approach?
Let's discuss if any query for the same.
 
Daniel WretmanDaniel Wretman

Hi Prakash

I had a look at the FilterCollection feature but was not really happy with it, I also had a second look at my requirement and realised that having a multiselect in the screen was a bad idea. I have to update roughly 21 000 entries and that is a lot of clicks so I'll do it with the data loader instead.

Thank you for your help.

Om PrakashOm Prakash
Thanks for the info Daniel.
Agree, for 21 000 records, Data Import Wizard or Data Loader is suggested.