You need to sign in to do that
Don't have an account?

How can I creat a list of sObjects to pass to an Action in Lightning Flows?
I'm working on an autolauched flow and I need to pass a list of sobjects to an apex class. I manage to get a collection of records but it isn't the right type, I need it to be a List
If you want to pass list of sObject from flow to apex action then try below.
1.) Create a Apex Class First
//Here is dummy Ref. class In above apex we are fetching list of contacts.
Now go to flow and folow below steps.
2.) In Flow Create a Get Records Element and fetch records of contact after create a get records element then folow 3 step.
3.) #1.drag and drop a Action Element
#2.add Filter on Type
#3. Select Apex Action
#4. search your apex class name and select it
#5. In Set Input Values you will be seen your apex class parameter Name
#6. Check toggle button
#7. In apex parameter input select your get element name
#8. Done And Save
I hope above info will help you.
let me know if it helps you by marking it as best answer.
Thank you
You can use that. The Collection variables are supported in the invocable method.
Make sure your class looks like this:
@InvocableMethod
public static List<String> Method1 (List<List<Account>> ListAcc){
}
or
@InvocableMethod
public static List<String> Method1(List<List<String>> ListAccIds){
}
You can retrieve the sobject record or the Ids from the flow.
If you use list<list<account>
//get the first List from the List of Lists
List<Account> AccountListReceived= ListAcc.get(0);
Please mark this as the best answer if that solves your problem. Thank you!