Flows: Is there a way to get records from multiple Ids at once in a flow? Something like get all Case records where Account Id in (multiple Ids) ? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Vibhor GoelVibhor Goel 

Flows: Is there a way to get records from multiple Ids at once in a flow? Something like get all Case records where Account Id in (multiple Ids) ?

Best Answer chosen by Vibhor Goel
Manasa UdupiManasa Udupi
A couple of ways to go about: 
1. If you know the Multiple IDs, you could use multiple assignments as below. If you use the same Fields multiple times, the Filter criteria would be set to OR.

User-added image
2. If you need to fetch the Account IDs dynamically then you could use a Get Record element to get all the Accounts that meets the criteria and store them in a collection variable.
Use a loop to iterate through each Account and then get the child cases using another Get Element. 
This isn't an optimal solution since a DML operation would be performed within a loop.

All Answers

Manasa UdupiManasa Udupi
Hi Vibhor,

You could use Get Records Flow Element, Get all the cases that meet certain criteria and store all the returned records.
User-added image
Vibhor GoelVibhor Goel
Thanks for the reply. My issue is if I want to query records like Get Cases where account Id in (multiple ids). I know we can give a single Id, but what if i want to get records based on multiple Ids?
Manasa UdupiManasa Udupi
A couple of ways to go about: 
1. If you know the Multiple IDs, you could use multiple assignments as below. If you use the same Fields multiple times, the Filter criteria would be set to OR.

User-added image
2. If you need to fetch the Account IDs dynamically then you could use a Get Record element to get all the Accounts that meets the criteria and store them in a collection variable.
Use a loop to iterate through each Account and then get the child cases using another Get Element. 
This isn't an optimal solution since a DML operation would be performed within a loop.
This was selected as the best answer