This is my array:
[
{
"User": "9xzcxzczxczxcczxc2cd31d69d51a",
"Tasks": [
{
"title": "Reception, validation and account of local suppliers invoices",
"dueDate": "2020-11-21T01:25:23Z"
},
{
"title": "Another task",
"dueDate": "2020-11-21T01:25:23Z"
}
]
},
{
"User": "25e6zxczxczxcxz7027d3c5",
"Tasks": [
{
"title": "Data maintenance of master & controle files in MFG-PRO",
"dueDate": "2020-11-21T01:25:23Z"
},
{
"title": "Yet another task",
"dueDate": "2020-11-21T01:25:23Z"
}
]
}
]
I need to send an email to each of these 2 users with a list of their respective tasks.
So, I'm trying to loop through the users with an "Apply to each" step.
But how to
My code above is (obviously wrong), the following:
Solved! Go to Solution.
Hello @WebPortal
You could do something like this:
1) For each item in the array
2) Get the email of the using its id using the expression:
items('apply_to_each')?['User']
3) Create a CSV table using the Tasks array using the following expression:
items('apply_to_each')?['Tasks']
4) Send the email
Hope it helps!
Ferran
Why not create a html table instead of CSV and send that to them?
Hello @WebPortal
You could do something like this:
1) For each item in the array
2) Get the email of the using its id using the expression:
items('apply_to_each')?['User']
3) Create a CSV table using the Tasks array using the following expression:
items('apply_to_each')?['Tasks']
4) Send the email
Hope it helps!
Ferran
It worked, thank You!
Only the formatting could be improved.. this is how it looks:
title,dueDate "Reception, validation and account of local suppliers invoices",2020-11-20T10:00:00Z Data maintenance of master & controle files in MFG-PRO,2020-11-20T10:00:00Z
Why not create a html table instead of CSV and send that to them?