
Hello everyone,
I am trying to figure out how to collect information from nested galleries. This is the scenario:
I have a project: Project XX
This project can run in different plants (depending on the project, it might run in one, two or three plants, for example, so this is dynamically done based on the project selected):Plant A, Plant B, Plant C
In each plant I receive different components with different volumes: component 1, component 2, component3, component 4
I have a table storing this information (plus some other columns, I am just simplifying the scenario)
ID Project Plant ComponentNumber Volume (plus other columns)
I designed an app where the user selects specific items from the previous mentioned table (project, plant, components) based on the supplier of the components (lets call this collection SelectedItems). In the screen I group (using GroupBy) this table by plant and show the result in a nested gallery (outer gallery the plants, inner gallery the components and volumes per plant):
Plant A
Component 1 Volume 1236
Component 2 Volume 3214
Component 3 Volume 7412
Plant B
Component 1 Volume 9632
Component 2 Volume 9852
Component 3 Volume 1236
Component 4 Volume 7456
Plant C
Component 1 Volume 1423
Component 2 Volume 3214
Component 4 Volume 7563
In the inner gallery, the user can modify the volumes (there are text inputs). So now I need to update the original source with this information. I used the following formula, but it is not working (it changes all the columns to the same volume, not depending what the text input in each gallery item contains)
ForAll(InnerGallery.AllItems,Patch(SelectedItems,LookUp(SelectedItems,ID=ThisRecord.ID),
{ComponentNumber:TI_ComponentNumber.Text,
Volume:Value(TI_Volume.Text)}));
I want to update all the items, so they can modify the values from the different gallery items and at the end save all the changes. I want to avoid asking the user to edit one item and save, go to the next one select edit and save. Is there a way to do a bulk update with nested galleries? Where does the button needs to be? I put it outside the nested galleries, in the item of the outer gallery and in each of the items in the inner gallery. The last one works, but it is not user friendly. How do I reference the formula so that it saves the value of the text input related to the item being saved? Any suggestions?