cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sialmiroma
Regular Visitor

Submit an entire child list (gallery) to a master list

Hello, I would like to submit an entire gallery to a master list.

 

Suppose I have the child list (gallery in PowerApps) with the columns first name, last name.

First Name | Last Name

Paul              McCartney

Ryan             Gosling

 

And I would like to submit all records to the master list: Date, first name, last name. How do I do this using one button? After pressing the button the master list would look like this:

 

Date | First Name | Last Name

1/8      Juan            Paulo

5/8      Paul             McCartney

5/8      Ryan            Gosling

 

Can someone help me with this?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

You can do this for the first 100 items loaded into a gallery (because that's all a gallery loads at one time), using code like this in the OnSelect property of a control such as a button:

ForAll(myChildGallery.AllItems As aItem,
    Patch(myParentDataSource, Defaults(myDataSource),
    {
        Date: aItem.Date,
        FirstName: aItem.FirstName,
        LastName: aItem.LastName
    })
)

If you need to do more than 100 items, consider using a Power Automate flow to do this in the background for better performance.

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
BCLS776
Super User
Super User

You can do this for the first 100 items loaded into a gallery (because that's all a gallery loads at one time), using code like this in the OnSelect property of a control such as a button:

ForAll(myChildGallery.AllItems As aItem,
    Patch(myParentDataSource, Defaults(myDataSource),
    {
        Date: aItem.Date,
        FirstName: aItem.FirstName,
        LastName: aItem.LastName
    })
)

If you need to do more than 100 items, consider using a Power Automate flow to do this in the background for better performance.

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Crullgl
Helper I
Helper I

Its pretty simple

 

Set(varNumber,'Your List'.ID);
Collect(
colGridData,
Patch(
varNewRecord,
{ForignID: varNumber}
)
)

*/Then if you want to display it with the record its associated with?/*

*/Add this to your table or Gallary to display child record that is assigned to the parent item /*

Filter(colGridData,ForeignID=varFormData.ID)

 

*/What this does is add the ID from the parent into the child list with the data that you want to capture. Then the second one allows you to line Thisitem:ID to the Child ID. Which I called Foreign Key.  You can create a column as number field and call it foreign key./*

 

 

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,663)