cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MadChemist
Helper I
Helper I

Update multiple records in gallery X on change of a toggle in gallery Y

Hello everyone,

 

I am facing the below problem, and I haven't found a solution yet....

 

Background
I have 2 galleries:

Gallery X: Contains all the change requests (Gallery: Requests, SP List: Tracker). The requests have a column (request_status), which is by default "open" and with a toggle it can be switched to "closed"

 

Gallery Y: Contains all the actions needed to be taken around the above change requests (Gallery: Action_Gallery, SP List: Actions). The actions have a column (action_status), which have similar functionality to above

 

I want to achieve the following: When a person closes a request, I want all the related to the request actions to be closed.

 

I have tried the below syntax, on the change of the toggle of the 1st gallery, without success...

The request name exists in both SP lists and it's the primary key used to connect everything

ForAll(Actions,Patch(Actions, ID = Requests.Selected.ID,{action_status:"closed"}))
ForAll(Filter(Actions, LookUp(Tracker, ID = Requests.Selected.ID,Request_Name) = Request Name),Patch(Actions, ID = ID, {action_status:"closed"}))

 

Thank you!!!

12 REPLIES 12
MadChemist
Helper I
Helper I

Thank you @Drrickryp , let me review the material and I will come back 😉
I will try to keep the chain alive 😛 

MadChemist
Helper I
Helper I

@Drrickryp 

 

After lots of trial & error + some extensive research around, I found the solution to my problem 🙂
The syntax which works for me is the below:

ForAll(Action_Gallery.AllItems, UpdateIf(Actions, Action_Name = GalleryX. Selected.Action_Name, {action_status = "closed"})

Essentially, I used the UpdateIf function (vs patch which I couldn't figure out), but I made sure not to use the same source in ForAll & UpdateIf. Instead, I used a combination of SP lists & Galleries.

 

Drrickryp
Super User
Super User

@MadChemist 

Ingenious!brain.gif

 

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

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

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,727)