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 / Stacking data from Tex...
Power Apps
Answered

Stacking data from Textinput in Gallery to Collection

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I want to collect data from the gallery where numbers have been entered in the TextInput, and store it in a Collection.

 

Example:

This my gallery, I have 4 row and key data in the Textinput 2 Row. (I want to keep data only 2 row.)

CookieNamtarn_0-1717952747696.png

i use Collect function to keep the result from gallery

Collect(    StackData,
    {
        '1.Topic': Title1.Text,
        '2.Result': TextInput1.Text
    })
But the problem is that the result does not meet the objective. In the table, there is only data in the second row. I want to collect the data in both the first and second rows (excluding the third and fourth rows because there are no values entered in the TextInput fields).

CookieNamtarn_2-1717953617920.png

How i can do it?

Thank you in advances

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @CookieNamtarn,

     

    On the Save button's OnSelect you could write the code below that will save all gallery items for which the Text Input control is not blank:

    //Save Button's OnSelect property
    ClearCollect(
     colStackData,
     ForAll(
     //Change GalleryName accordingly
     Filter(
     GalleryName.AllItems,
     !IsBlank(TextInput1.Text)
     ),
     {
     '1.Topic': Title1.Text,
     '2.Result': TextInput1.Text
     }
     )
    )

     


    If this solves your question, would you be so kind as to accept it as a solution✔️

    If you liked my solution, please give it a thumbs up👍

     

    Connect with me: LinkedIn | Blog

  • CookieNamtarn Profile Picture
    on at

    It's work!!!
    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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard