We have a scenario that is triggered by sending or receiving an email in a Microsoft 365 Email account. From that email we want create a single array containing only the email addresses of anyone and everyone found in the To, From and CC fields. With that array, we plan to use the Iterator to look-up and link contacts in our CRM. What is the simplest way to accomplish this?
Welcome to the Make community!
If you have multiple arrays, you can join them using the built-in function merge()
.
For more information, see https://www.make.com/en/help/functions/array-functions#merge--array1--array2------
so if I had an array that has name and email for each, and then for the From field it has the same fields but is not considered an array would I use ADD and MERGE? Also is there a specific Tool I should use to use these functions?
Welcome to the Make community!
1.
Please share screenshots of the scenario / module fields and filters in question? It would really help other community members to see what you’re looking at.
2.
Please provide sample output bundles of the modules by running the scenario, then click the bubble on the top-right of each module, save the contents as a bundle.json
file, and upload it here into this discussion thread:
Following these steps will allow others to assist you here. Thanks!
Bundle: bundle.json (2.1 KB)
Basically, I want all of the information in the screenshots into a single array to use with Iterator. Output bundle is at the top of this post.
You’ll need at least two modules because the format for “From” is not an array.
1.
First, we build the object for “From” using Parse JSON.
{
"From": {
"Email Address": {
"Name": "{{17.From.`Email Address`.Name}}",
"Address": "{{17.From.`Email Address`.Address}}"
}
}
}
2.
Next, we merge()
the “To” and “Cc” arrays, then add()
the “From” variable into the array.
Output
Thanks! I actually figured this out a more efficient way, it seems. I reached out to some folks on a separate website and they mentioned the map function, which seemed to unlock a thought process for me.
Excellent, that works
Hello @Adam_Rondeau welcome to the community
I just wanna say a quick congrats on solving this one with the help of @samliew.
Also, thanks a lot for remembering to share your insights with us and marking them as a solution. This way our community stays organized and easy to navigate for any folks searching for similar info in the future.
Keep up the great work!