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!!!
If toggle1 is on galleryx set the default property of all the dependent toggles on galleryy to toggle1.Value. Set the OnChange of toggle 1 to do the patch.
This is simple and practical, however, I would also need to use a LookUp somewhere inside the dependent toggles, since I want only the related records to adjust, right? I will give it a try and come back to you.
When it comes to ForAll + Patch to create new records, there I have managed with a Collection
When it comes to adjusting existing records on a 2nd gallery by manipulating a toggle on a 1st gallery, it gets a bit trickier 🙂
No, it's not, it's getting filtered though by selecting some dropdowns (outside gallery) or tickbox (inside gallery).
99% the users will NOT have it filtered when they hit the toggle
Quick question, is the tracker list in a one-to-one or one-to-many relationship with actions?
Exactly, yes
Ah sorry, it's one (request) to many (actions).
my biggest issue is identifying the right structure for the record, inside the Patch.
even the request_name(galleryY) = gallery.selected.request_name(galleryX)
Take a look at my blog post on keys and relationships https://powerusers.microsoft.com/t5/News-Announcements/Relational-Database-Principles-and-PowerApps-... and the following one https://powerusers.microsoft.com/t5/News-Announcements/Relational-Database-Design-fundamentals-Imple... on how to structure the database in PowerApps from data stored in SharePoint. I think we can come up with a solution for you.
User | Count |
---|---|
196 | |
126 | |
87 | |
49 | |
42 |
User | Count |
---|---|
284 | |
162 | |
138 | |
75 | |
72 |