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 / ForAll Gallery.AllItem...
Power Apps
Answered

ForAll Gallery.AllItems Collect values from gallery returns same value for items if you use As

(0) ShareShare
ReportReport
Posted on by 293

I have a gallery with an text input box and I was trying to use the following power fx:

 

 

 

Clear(myCollection);
ForAll(
myGallery.AllItems As item, 
 Collect(myCollection, {value : textinput1.text})
)

 

 

 

The result of this is that all values returned to myCollection are the same value, that of the first item.

 

 

Categories:
I have the same question (0)
  • Verified answer
    SagarVIS96 Profile Picture
    212 on at

    Hi @KASCHN ,

     

    You can use the following code:

    Clear(myCollection);
    ForAll(
    myGallery.AllItems As item, 
     Collect(myCollection, {value : item.textinput1.text}
    )

     

    Thanks

  • KASCHN Profile Picture
    293 on at

    @SagarVIS96 Good catch. I knew it had something to do with the As item! thank you

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 430

#2
timl Profile Picture

timl 318 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard