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 / Powerapps using a Fora...
Power Apps
Unanswered

Powerapps using a Forall in a collect

(0) ShareShare
ReportReport
Posted on by 32

Hi Community,

Bit of a headscratcher here, feel like this should be simple but running into roadblocks.  I am trying to create a collection using some variable data.  In short I want to create a collection where multiple headers are created using a Forall Function.  Here is what I have created:

First I have these two collections which the Forall's look at

 

ClearCollect(Collection_TechnicianList,
 {TechnicianName:"JK", TechnicianEmail:"J*****.K*****@*****.co.uk", TechnicianFullName:"J***** K*****"},
 {TechnicianName:"MD", TechnicianEmail:"M*****.D*****@*****.co.uk", TechnicianFullName:"M***** D*****"},
 {TechnicianName:"RW", TechnicianEmail:"R*****.W*****@*****.co.uk", TechnicianFullName:"R***** W*****"},
 {TechnicianName:"ST", TechnicianEmail:"S*****.T*****@*****.co.uk", TechnicianFullName:"S***** T*****"})
//Lists all the status' for reports
ClearCollect(Collection_Status,
 {StatusSelection:"New"},
 {StatusSelection:"In Progress"},
 {StatusSelection:"Awaiting Reposne"},
 {StatusSelection:"Awaiting Technical Information"},
 {StatusSelection:"Awaiting Client Approval"})

 

 

From these I am then trying to create the collection, but I run into errors, here are the two variations I have attempted.

 

 

Clear(Collection_Report_Technician_ClosedType);

ForAll(Collection_TechnicianList,
 Collect(Collection_Report_Technician_ClosedType,
 { 
 Technician:TechnicianFullName,

 ForAll(Collection_Status,
 StatusSelection:
 CountIf('Enginering Ticket System',
 'Ticket Type'.Value=StatusSelection,
 DateValue('Closed Date') >= DatePicker_ReportStart.SelectedDate,
 DateValue('Closed Date') <= DatePicker_ReportEnd.SelectedDate,
 Status.Value="Completed",
 'Assigned to'.Email=TechnicianEmail
 )
 )
 }
 )
);
Clear(Collection_Report_Technician_ClosedType);

ForAll(Collection_TechnicianList,
 Collect(Collection_Report_Technician_ClosedType,
 { 
 Technician:TechnicianFullName}));

ForAll(Collection_Status,AddColumns(Collection_TechnicianList,StatusSelection,ForAll(Collection_TechnicianList,LookUp(Collection_Report_Technician_ClosedType,Technician=TechnicianFullName,CountIf('Enginering Ticket System',
 'Ticket Type'.Value=StatusSelection,
 DateValue('Closed Date') >= DatePicker_ReportStart.SelectedDate,
 DateValue('Closed Date') <= DatePicker_ReportEnd.SelectedDate,
 Status.Value="Completed",
 'Assigned to'.Email=TechnicianEmail)))))

 

 

Any ideas on how I can get this to work?

Whilst writing this I have noticed that there is a slight problem of I need to add a comma at the end of each all which I probably should do with a Concatenate and some magic to remove it from the last one.

Categories:
I have the same question (0)
  • russgove Profile Picture
    6 on at

    Hi,

    What result are you trying to get?

    Can yo show sample data from Engineering Ticket System?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard