Announcements
ForAll(MyGallery; Collect(myCollection; {a:FieldA; b:FieldB}))I'm trying to collect two fields for every item in the gallery. How should the code be written?
@agneum
I think you were just missing the ".AllItems" after MyGallery.
ForAll(MyGallery.AllItems; Collect(myCollection; {a:FieldA; b:FieldB}))
---Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
This works:ForAll(MyGallery.AllItems; Collect ( myCollection; FieldA.Text; FieldB.Text ) )
Depending what type of data FieldA and FieldB have.I recomend to add Clear(myCollection) before the ForAll depending on the case.
If you ran in the same issue, being unable to load all items in a Gallery, please vote and support this idea: Enable the option to load all items in a Gallery · Community (powerapps.com)
The semicolon after all items is wrong. It needs to be a comma.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 356 Most Valuable Professional
11manish 225 Super User 2026 Season 2
Mohsin Ali 211