Is it possible to loop through two collections and compare values?
I would like to look up values on the Contact object and compare them to values in a Custom Metadata object. The Contact object will be updated if mailing address data on the Contact Object matches data in the Custom Metadata Object.
I know that this could be done using fast look up and comparing one record at a time to the Custom Meta Data collection and maybe that is the best way? I am just used to using fast lookups for everything.
Best Answer
I think this challenge can be approached using string collection variables. It's tough to describe an imagined Flow, but I think it'd go something like this:
I don't think you'll be able to approach it as comparing a list of addresses to a list of addresses; Flow doesn't have Address as an first-class type. You could do that in Apex with a Set of a custom class that implements
hashCode()
(although it wouldn't be an especially natural idiom there either).Breaking it down into specific data points and ANDing criteria (
listOfCities CONTAINS contactsCity AND listOfZIPs CONTAINS contactsZip AND...
) is going to fit the bill for this application.