Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Stacking data from Textinput in Gallery to Collection

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:
  • Re: Stacking data from Textinput in Gallery to Collection

    It's work!!!
    Thank you.

  • Verified answer
    LaurensM Profile Picture
    LaurensM 12,525 on at
    Re: Stacking data from Textinput in Gallery to Collection

    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

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard