Power Apps GroupBy Function and Nested Galleries
GroupBy function in PowerApps is super helpful but not super easy to use. So I make it better.
Comments
-
Power Apps GroupBy Function and Nested Galleries
Hi Shane, great Video! My 1st gallery is on the main screen. I needed to group the gallery by department but since department is a choice in a list in sharepoint I needed to use this formula to get the department showing
GroupBy(AddColumns('Department of Pediatrics Team List', "DivisionGroup", Division.Value), "DivisionGroup", "DG"
On my second screen I have the child gallery to show the names of the teams when the Gallery in my main screen is selected. The Item for the child gallery is Gallery1.Selected.DG and for the OnSelect I have Set(varRecord, ThisItem). Also, in my second screen I have a form to view the details of the team member selected in the gallery on screen 2. The Item of the form is varRecord and I have added buttons for changing the FormMode to Edit or New modes. I also have a back arrow to reset the gallery so information from the child gallery will not show when I click a different department.
My issue is when submitting in edit displaymode. On the OnSuccess for the form I have Set(varRecord, Form6.LastSubmit); ViewForm(Form6). This helps me view the last submitted record but my child gallery refreshes to the first record in that gallery and does not show the last record submitted and completely disregards the selected team member for updating/editing.
Is there a way for me to force the child gallery to show the selected team member (and also show other team members for that department) on OnSuccess? Thanks for the help! I have only been using powerapps for like a month and all of it is self taught and I am not tech savvy at all but knowing a very little M language and excel helped a little.
*This post is locked for comments