In a screen flow, is there a way to leverage a single Get Records data element to retrieve multiple records (3) of the same kind (object: Areas of Interest) based on 2 distinct variables (“Rank” and “Type”). The goal is to get a contact's 3 most recently created "Areas of Interest" record(s) with ranks of 1, 2, and 3 (generally created at the same time in groups of (3), but this is not guaranteed) and display each record's respective type values in a flow's screen with text fields labeled “primary,” “secondary,” and “tertiary.” So basically, if went through the flow on 06/01 and selected the following values (each appearing in its own record):
- Primary (rank) = "Hockey" (type), Created on 06/01
- Secondary (rank) = "Basketball" (type), Created on 06/01
- Tertiary (rank) = "Football" (type), Created on 06/01
My goal is to display the previously selected record values if I'm going through the same flow again at a later time (e.g. 10/18) in the screen's respective fields of "primary," "secondary," and "tertiary." I realize this can be achieved using (3) separate get records elements, but I would like to learn if it's possible to do this with one get records element. I'm not sure how I would go about storing each record's separate values and refencing them again later for displaying in the flow's screen.
Eric Burté (DEVOTEAM) Forum Ambassador
Hello @Dusty Buell, you can sort the collection of AreasOfInterest by any fields (in an ascending/descending way). Some materials to see how it works :
- https://help.salesforce.com/s/articleView?id=release-notes.rn_automate_flow_builder_sort_limit_collection.htm&release=232&type=5
- https://salesforcetime.com/2023/08/15/how-to-use-the-collection-sort-element/
- https://www.youtube.com/watch?v=i-cxkFo5GCs
This way, you only use one GetRecords action
Eric