Skip to main content

Notifications

Community site session details

Community site session details

Session Id : uGX2ZXGbfGsMiVG4xqvC2C
Power Apps - Building Power Apps
Answered

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

Like (0) ShareShare
ReportReport
Posted on 21 Jan 2023 13:42:33 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.

 

 

  • KASCHN Profile Picture
    293 on 21 Jan 2023 at 14:27:00
    Re: ForAll Gallery.AllItems Collect values from gallery returns same value for items if you use As

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

  • Verified answer
    SagarVIS96 Profile Picture
    212 on 21 Jan 2023 at 13:54:39
    Re: ForAll Gallery.AllItems Collect values from gallery returns same value for items if you use As

    Hi @KASCHN ,

     

    You can use the following code:

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

     

    Thanks

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 262 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 134

#3
stampcoin Profile Picture

stampcoin 123

Overall leaderboard