Skip to main content
Community site session details

Community site session details

Session Id : DkZromrWy0jWpBNt1qe7YK
Power Apps - Building Power Apps
Answered

Store Individual Items from a GalleryView in a collection

Like (0) ShareShare
ReportReport
Posted on 7 Jun 2021 14:01:49 by

I have a gallery that will take in user input. The gallery has column names that auto populate based on the data source provided, and the number of text inputs varies based on that. When I hit the submit button in our form, I want to store all the text inputs in a collection that corresponds directly to the column name. For example, when I hit submit, the collection should show Operator Initial and then the written input as one row, and then do this for the rest of the rows. 

ranamerp_0-1623074321188.png

 

I have struggled with trying to figure out how to store the data. The closest to a solution I have come up with is the following code: 

 

 

ClearCollect(FormData, {Date: DatePicker1_1, ColumnNames: Gallery1_2.AllItems.Label9_1 , Item: Gallery1_2.AllItems.TextInput4_1, Comments: TextInput3_2});

 

 

However, this stores the objects of data, not the actual data (shown below). 

ranamerp_1-1623074360318.png

My question is this: How do I store the individual items into their rows directly from a single button. I apologize if there's an obvious answer I'm missing, as I'm still really new to the Power Apps Platform. 

Categories:
  • Community Power Platform Member Profile Picture
    on 07 Jun 2021 at 14:31:21
    Re: Store Individual Items from a GalleryView in a collection

    Thanks for the reply. I definitely misunderstood that a gallery was already a table, and realizing that helped me better figure out how I want to handle this data. The formula was exactly what I was looking for, so thank you so much for that guidance.  

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 07 Jun 2021 at 14:08:43
    Re: Store Individual Items from a GalleryView in a collection

    @Anonymous 

    Your Gallery already is a collection/table of values.  Duplicating in a collection is not seemingly relevant to where you are trying to go.

    So, if we skip the collection, where exactly are you going with the data?

    Also, specifically to what you are seeing, you are referencing the objects/controls in your Gallery, not the values.  So, Label9_1 is a control...Label9_1.Text is the text value that you want.

     

    The reason I ask about where you are going with this is because it almost seems like you are planning to then update specific columns in your datasource based on those names - perhaps dynamically - which will not work.

    Possibly that is not where you are going, but I wanted to save you the grief of trying to figure out what issue you have now only to find you'll have a bigger issue later.

     

    I hope this is helpful for you.

     

    EDIT: Oh, and if you want a table with the single values, then this is the formula:

    ForAll(Gallery1_2.AllItems, 
     {Date: DatePicker1_1.SelectedDate, 
     ColumnName: Label9_1.Text, 
     Item: TextInput4_1.Text, 
     Comments: TextInput3_2.Text
     }
    );

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 our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473