I have difficulties figuring out how to dynamically select a record in gallery. Usually, when I connect a datasource to the Gallery and have an edit form, I would set a gallery "Default" property to a variable, for example, "CurrentlySelectedItem", then "On Select" property would use Set(CurrentlySelectedItem,ThisItem). This way when I submit the form, my previously selected record stays selected. I have difficulties figuring out how to apply this concept to a Gallery where Datasource is grouped (GroupBy). Example:
Dataverse Datasource:
Key | Year | Service. | Representative | Location | Amount |
---|---|---|---|---|---|
2022Service1Name1NJ | 2022 | Service 1 | Name 1 | NJ | 500 |
2021Service 2 Name 2NJ | 2021 | Service 2 | Name 2 | NJ | 200 |
2021Service 2Name 3MIA | 2021 | Service 2 | Name 3 | MIA | 150 |
I would GroupBy Key Column, which basically a concatenation of all the other columns except Amount. I select an item in Gallery, and use TextBoxes to change data in all the Columns that correspond to the selected Key (Using PatchIf Function). Then the key is being updated, and then the Record is not selected anymore. Any ideas how I can select a specific group in gallery? Thank you!