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
Paul Redmond 7Paul Redmond 7 

Passing multiple Ids From a flow to InvocableMethod

Hi.  I have a flow & I'm trying to pass a list of selected Ids to an Invocable Method that takes List<String> ids as a parameter.

When creating the Resource (Text variable, available for input) as "Allow multiple values (collection)" I get the error that "The data type of the resource you entered isn't compatible." when trying to set the input variable as that resource.

I tried setting the resource with unchecking the "allow mutliple values" and in my method I only get the single string.

Is it possible to pass a list of ids into the method or is this limited to a single value?

Thanks
Best Answer chosen by Paul Redmond 7
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Paul,

You may need to concatenate all the string usin some limitor and send as single parameter and then you can split the string based on split function on the string.

The same is done in the question below. Can you check this.

https://developer.salesforce.com/forums/?id=9060G0000005nrjQAA

If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Paul,

You may need to concatenate all the string usin some limitor and send as single parameter and then you can split the string based on split function on the string.

The same is done in the question below. Can you check this.

https://developer.salesforce.com/forums/?id=9060G0000005nrjQAA

If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Paul Redmond 7Paul Redmond 7
Thanks Sai, I followed  your advice, created a comma delimited string from a loop within the flow & passed it into the method.

Cheers