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 / Patch items listed in ...
Power Apps
Suggested Answer

Patch items listed in a gallery to Data verse

(0) ShareShare
ReportReport
Posted on by 47
Hi all,

I am building a custom page in my model driven app.

I have a custom button on the main ribbon that when pressed opens a custom page and pulls in via a JS parameter the Guid of the items I have selected in the view before pressing the button.

For dev sake my Gallery called is Gallery6. It's items are from a collection called accids.

Accids collection is populated like via the application start menu:

Set(recordIds,Param("recordId"));
ClearCollect(colSplittedIds,Split(recordIds,","));
ClearCollect(accids,Filter('ECOS Traces','ECOS Traces' in colSplittedIds))
 
On the rest of my page I have two controls one hooked up to a choices menu called Subsidary - control name called cmb_subsidary
I also have a description text box called txt_description.

Now on my custom page the user selects a value from cmb_subsidary and enters text in the txt_description control.

I then need to patch them values to my ECOS Traces table using the GUID's listed in Gallery6

There is a text lbl in Gallery6  that holds the GUID values of the selected records it's called txt.ID

So I was thinking of something like this on a button:
 
Patch('ECOS Traces',ForAll(
    Gallery6.AllItems,
 
{
 
Description: txt_description,
Subsidary: cmb_subsidary.Selected.Value
 
}
 
));
Navigate('ECOS Traces (Views)'.'Active ECOS Traces')

The values are not being patched. I think I am missing This Record or something or using a filter using the txt.ID field in the gallery?

Any suggestions, appreciated.
I have the same question (0)
  • Suggested answer
    MichaelFP Profile Picture
    1,997 Moderator on at
    you are doing wrong you need to invert the process.
     
    ForAll(Gallery6.Allitems,
        Patch('ECOS Traces',
            ThisRecord, //current record from the gallery
          {
             
          Description: txt_description,
            Subsidary: cmb_subsidary.Selected.Value
           }
        )
    )
     
     
    In that case you will loop for itens in gallery and will patch each record of ECOS Trace table.

    If my answer helped you, please give me a thumbs up (👍). If solve your question please mark as answer ✔️. This is help the community.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 899

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 499

Last 30 days Overall leaderboard