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 / How to get second reco...
Power Apps
Answered

How to get second record values from Gallery

(0) ShareShare
ReportReport
Posted on by 25

I have a gallery with an add button to dynamically add records to it. Each record has three dropdowns (company, department, employee) and a number text input to add the daily working hours. 

What I want to do is to save these values into an entity with each record in the gallery on a separate row.

So the main question is, how can I get values from second, third... records of the gallery not just the first one.

Thanks for any help.

Capture.PNG

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @samerhajjar 
    The AllItems property of the Gallery will give you access to all the rows.

    Gallery1.AllItems

     

    You would build a collection like this:

    ClearCollect(
     colUpload,
     ForAll(Gallery1.AllItems, {
     Col1: Dropdown1.Selected.Value,
     Col2: Dropdown2.Selected.Value,
     Col3: Dropdown3.Selected.Value,
     Col4: TextInput4.Text
     }
    );


    Then you can import the collection into your entity.  The column names must match your entity.

    Collect(yourEntityName, colUpload)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • samerhajjar Profile Picture
    25 on at

    @mdevaney 

    Thanks for your help. 

    What you posted is part of what I want to do. I also wonder, when saving the data from the gallery, each row will also have separate data that is outside the gallery (i.e. datepicker, textinput...) saved with it, it would be same date and same text for all gallery rows.

    Any idea how to do that? I'm new to powerapps and would appreciate any help.

    Thanks. 

  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @samerhajjar 

    Actually, its done the exact same way.  If you reference the name of a datepicker or textinput outside the gallery it gets applied to all rows in the collection 🙂

    ClearCollect(
     colUpload,
     ForAll(Gallery1.AllItems, {
     Col1: Dropdown1.Selected.Value,
     Col2: Dropdown2.Selected.Value,
     Col3: Dropdown3.Selected.Value,
     Col4: TextInput4.Text,
     Col5: DatePicker5.SelectedDate // outside the gallery
     Col6: TextInput6.Text // outside the gallery
     }
    );

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • kamil_mac Profile Picture
    4 on at

    I have the same problem ;(

     

    When I change the one input field and perform onselect on the button, all values change to the value from the last edited input field.

     

    My collection for creating a Gallery with one Input field:

    ClearCollect(
     test2;
     {
     id: "1";
     value: varGalleryViewItem.NumerFormy
     };
     {
     id: "2";
     value: varGalleryViewItem.NazwaDetalu
     };
     {
     id: "3";
     value: varGalleryViewItem.Item
     };
     {
     id: "4";
     value: varGalleryViewItem.Wtryskarka
     }
    )

     

    Function for OnSelect for a button:

    ClearCollect(
     test2;
     ForAll(Gallery1.AllItems; {
     value: CzasCykluZlecenieInput_1.Text;
     id: id
     })
    );;

     

    My gallery has four row:

    kamil_mac_0-1701451155576.png

     

     

    When I change the first field to A999999 and click the test button, all values change to the same

    kamil_mac_1-1701451267982.png

     

  • kamil_mac Profile Picture
    4 on at

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard