I needed to sort a gallery by two columns; Document title and Document type (both ascending/descending). I also needed to filter those columns based on entries from previous selections. I began by creating a variable (sort1) and 2 buttons for each of the columns that would be sorted, one ascending and one descending. The buttons "on select" changed the value of the variable to 1,2,3 or 4 depending on the selected button. Set(sort1,1) etc...
If(
Sort1 = 1, Sort(Filter('Controlled Documents v3', Location = Dropdown2_11.Selected.Result , Process = Dropdown2_15.Selected.Result , 'Sub Process' = Dropdown2_13.Selected.Result),'Document Type',Ascending),
Sort1 = 2, Sort(Filter('Controlled Documents v3', Location = Dropdown2_11.Selected.Result , Process = Dropdown2_15.Selected.Result , 'Sub Process' = Dropdown2_13.Selected.Result),'Document Type',Descending),
Sort1 = 3, Sort(Filter('Controlled Documents v3', Location = Dropdown2_11.Selected.Result , Process = Dropdown2_15.Selected.Result , 'Sub Process' = Dropdown2_13.Selected.Result),'File name with extension',Ascending),
Sort1 = 4, Sort(Filter('Controlled Documents v3', Location = Dropdown2_11.Selected.Result , Process = Dropdown2_15.Selected.Result , 'Sub Process' = Dropdown2_13.Selected.Result),'File name with extension',Descending)
)
I know it isn't the most elegant format. 😇 Thanks again for the support the previous posts helped me figure out where to start!