We are having trouble with a flow where we need to filter an array of objects.
So this is the use case:
- We are starting with a list rows from an excel table (the table has multilple rows with multiple columns which store information we need later on in the flow)
- There are two filter array actions to filter the list of values coming from the list rows action (first filter is for country codes and second filter is the exclude internal entries based on internal email addresses)
- After the two filter array actions, the output of the list rows action is nearly where we need it
- The array has multiple objects in it with different values coming from the excel table (such as first name and last name of a contact, the company name, the email address or the department code)
- But we have the case where we have two or more objects where the email address is identical
- We only need the first or a unique object for one email address (so for example: we have 10 objects in the array where in three objects the email address is the same. We need to exclude the two "double" objects with the identical email address to reduce the array to 8 objects with only unique email addresses)
- We already tried a compose with the union function based on the email address, but with that all the other information within the objects we took from the excel file is lost and we need that information
So the general question is how can we filter an array of objects based on a single value within the objects (in our case the email address).
Thank you guys in advance for assistance!