Hi all, thanks in advance for your help, I'm trying to build an app to send email to responsible persons, each record in the collection is an action plan previously sorted by responsible, the idea is to send one email por responsible including all his action plans, instead of several emails one per action plan. I did it using just a Gallery but the results were unexpected, since gallery takes some time to refresh, i got values sticky from other records in some rows randomly. So, now I've created a Collection from the Gallery and working with the collection, however I got a mess with variable and record scopes, I've tryed many options read the disambiguation and context but i can´t get it. the follow code got the different errors. Please your help on this issue.
The code do this:
1. Create a collection with emails of responsibles
2. Create a collection copy of the Gallery which contains the action plans
3. Send a email to each responsible
3.a Filter the colecction colActionPlan by responsible
This code doent run, however if I remove the filter it works, but send all action plans to each responsible.
Works:
Concat(colActionPlans; "<tr> <td>" & colActionPlans[@ActionAgreed] & "</td> <td>" & Label18.Text & "</td> <td>" & Label25.Text & "</td> <td>" & Label23.Text & "(" & Label24.Text & ")" & "<td>" & Label22.Text & "</td>" & ThisRecord[@Label21].Text &"</td></tr>"
)
Doesnt work (I've tryied severals ways but none works)
Concat(Filter(colActionPlans; colActionPlans[@Action_x0020_Plan_x0020_Responsi]) = [[@ThisRecord])); "<tr> <td>" & colActionPlans[@ActionAgreed] & "</td> <td>" & Label18.Text & "</td> <td>" & Label25.Text & "</td> <td>" & Label23.Text & "(" & Label24.Text & ")" & "<td>" & Label22.Text & "</td>" & ThisRecord[@Label21].Text &"</td></tr>")
Thanks
ClearCollect(colDestinos; Distinct(Gallery1.AllItems; Label21_1.Text));; //this list contain the emails of responsibles its filled with a DISTINCT function.
ClearCollect(colActionPlans; Gallery1.AllItems);; //create a Collection from the Gallery with action plans
ForAll(colDestinos;
Office365Outlook.SendEmailV2(
"simon.toledo.araya@sqm.com";
"Planes de Acción Vencidos al Log " & Text(DatePicker1.SelectedDate;"dd/mm/yyyy") & " ("& ThisRecord.Value &")" ;
TextInput1.Text & " <div class=" & Char(34) & "table_component" & Char(34) & " role=" & Char(34) & "region" & Char (34) & " tabindex=" & Char(34) & "0" & Char(34) & "> Dear all this are your action plans. We expect your answer on <b> " & Text(DatePicker2.SelectedDate;"dd/mm/yyyy") & "</b> <br><table><tr> <th> Action Plan</th><th> Due Date. </th> <th>Issue</th> <th> Report </th> <th> Comments </th> <th> Responsible </th></tr>" & Concat(Filter(colActionPlans; colActionPlans[@Action_x0020_Plan_x0020_Responsi]) = [[@ThisRecord])); "<tr> <td>" & colActionPlans[@ActionAgreed] & "</td> <td>" & Label18.Text & "</td> <td>" & Label25.Text & "</td> <td>" & Label23.Text & "(" & Label24.Text & ")" & "<td>" & Label22.Text & "</td>" & ThisRecord[@Label21].Text &"</td></tr>"
) & "</table> <br> " & ThisRecord.Value
));;

Report
All responses (
Answers (