I have a Flow that compares 'VehNo' from two arrays "ListVehNo" and "InspVehNo" and then appends non-common results to a third array "MissVehNo". ListVehNo and InspVehNo are populated via Get items and append to array variables.
I now need to collect VehNo related info from "ListVehNo" (i.e., 'Supervisor') to send emails. My first thought was to run a Get items where the SP List VehNo equals the MissVehNo. I would then "Apply to each" these values and append to another array MissVehNoSupv. values would include the VehNo and Supervisor.
{
"MVehNo": @{items('Apply_to_each_4')?['Title']},
"Supervisor": @{items('Apply_to_each_4')?['field_3']}
}
Is this the best method to accomplish retrieving the Supervisor field or is there a more efficient way?
If the SP list used to populate the ListVehNo is the same that has the Supervisor information you can add all needed information to the ListVehNo and then into MissVehNo upon comparison.
If the lists are different you need to use get items again. You could create a filter string and run once or get all supervisors and cache it or run get items for each ListVehNo. It all depends on how many records you have.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1