web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Record scope forall, c...
Power Apps
Unanswered

Record scope forall, concat and filter

(0) ShareShare
ReportReport
Posted on by

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
));;

 

 

 

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard