I have the below code working fine for filtering my gallery based on a couple comboboxes...
Filter(
EDLS,
And(
Or(
IsBlank(cmb_2_1.SelectedItems.Value),
IsEmpty(cmb_2_1.SelectedItems.Value),
Production_Name in cmb_2_1.SelectedItems.Value
),
Or(
IsBlank(cmb_2_2.SelectedItems.Ep),
IsEmpty(cmb_2_2.SelectedItems.Ep),
Episode_Number in cmb_2_2.SelectedItems.Ep
)
)
)
But I now want to add sort buttons.
I've added the below code onto 2 buttons...
//Button 1
UpdateContext({EpSort: !EpSort})
//Button 2
UpdateContext({ProdSort: !ProdSort})
I have amended the code on my Gallery to the below but it's not working and I'm a bit stumped...
SortByColumns(
Filter(
EDLS,
And(
Or(
IsBlank(cmb_2_1.SelectedItems.Value),
IsEmpty(cmb_2_1.SelectedItems.Value),
Production_Name in cmb_2_1.SelectedItems.Value
),
Or(
IsBlank(cmb_2_2.SelectedItems.Ep),
IsEmpty(cmb_2_2.SelectedItems.Ep),
Episode_Number in cmb_2_2.SelectedItems.Ep
)
),
Episode_Number If(EpSort, Descending, Ascending),
Production_Name If(ProdSort, Descending, Ascending)
)
Any help greatly appreciated.
Thanks,
Rob