cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Blinkorta
Frequent Visitor

Patch all items in Gallery

 

PowerApps2.JPGI don't know if this is possible. I've seen other posts online of people exploring saving things in a Gallery but i'm not sure if my specific setting will work. Basically I have a Gallery that shows the "astID" field of a Collection and a textbox that shows the "astExplanation" field from the same collection. I want the user to be able to fill in the textboxes then click Save and have all the records in the gallery patched or updated with the new data. This is what I currently have on the Save button. I don't have any errors but it doesn't work. Nothing happens when clicked. 

 

ForAll(Gallery3.AllItems, Patch(tblInvenTemp, {astID: Label34.Text},{astExplanation:TextInput3.Text}))

And I know I should rename the label and textbox.  

11 REPLIES 11
Matthewvize
Helper I
Helper I

For new records using patch the record would be Defaults(DataSource) 

Just to complete your answer, this worked for me:

IfError(
    ForAll(
        myGallery.AllItems,
        Patch(
            [@myTable], //The table name to update. [@...] is mandatory.
            ThisRecord, //Get current ForAll item
            {
                'tableColumn1': myInput1.Text, //Update column of table with input text in gallery.
                'tableColumn2': myInput2.Text,
                'tableColumn3': myInput3.Text
            }
        )
    ),
    Notify("Error saving records")
);
Refresh(myTable)

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,900)