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 / Using ForAll() with co...
Power Apps
Answered

Using ForAll() with collections - how to get the values of the collection?

(0) ShareShare
ReportReport
Posted on by 235

Hi,

 

I have a collection with the following structure.

ClearCollect(
colExample,
 {
 ID: 1,
 Section: true
 },
 {
 ID: 2,
 Section: false
 }
...
);

 

Now I would like to generate a new collection "colCollection" with further content based on the information of "colExample". To go through each line of collection "colExample" I want to use ForAll().

 

ClearCollect(
colCollection,
 {
 ForAll(colExample,"Example " & colExample.ID & ", Section: " & 
 If(colExample.Section, "yes", "no")
 )
 }
)

 

The final result should be a collection (colCollection in the example above) which contains strings, e.g.

"Example 1, Section: yes"

"Example 2, Section: no"

 

My problem is the ForAll() code above does not work. How do I get the values of colExamples, e.g. ID, inside the ForAll()?

 

Thanks for your help.

 

Best regads,

Michael

 

Categories:
  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @MichaGue ,

     

    Are you trying to achieve something like this?

    ForAll(
     colExample,
     With(
     {
     CurrentExampleRecord: ThisRecord
     },
     Collect(
     colCollection,
     {
     Example: "Example "&CurrentExampleRecord[@ID],
     Section: If(CurrentExampleRecord[@Section], "yes", "no")
     }
     )
     )
    )

     

    I hope this helps

  • MichaGue Profile Picture
    235 on at

    You have put me on the right track. I was unfamiliar with the spelling:

    CurrentExampleRecord[@ID]

     

    Thanks for the fast feedback. Best regards.

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard