One of the big asks for Flow is to be able to have the ability to get Records where the Id is IN a list of Ids. There is an idea on the idea exchange which, at the time of writing this post, has 6,330 points. This is a hot request as many times in the Flow you know the Ids and can create a list of Ids, but you can’t Query based on that list of Ids. Until now.
With Flow Components Winter ’21 release, there is now the ability to query Records where the Id is IN a collection. There is an Apex Action, Get Records WHERE Id is IN List, that makes this possible. In the Flow Apex Action, there are a few pieces to set to ensure you can use the Action. First, the Action needs to know what the Object is for the list of Records that will be returned. When you click into the box, it will give you a list of objects to select from. In the example below, the Contact object was selected. Next, you need to include the Text Collection Variable. This does need to be a Text Collection variable of Ids only. If you’d like to select records from a Related List, check out the Related List Button to Send Records to Flow post. Finally, click the Manually Assign Variables (Advanced) checkbox to set the Record Collection Variable. This should be a variable, type Record, where you are selecting the same Object as the Object that you’re Querying. In the example below, since the Contact object is being queried, the record collection variable is for the Contact object. Make sure that you select the Allow multiple values (collection) checkbox on your variable. The query will return all available fields that the User has access to for the object that you select.