Hi guys,
I have a Gallery showing data from 2 different SP lists.
List 1 - Opportunities
List 2 - Companies
My Gallery is currently sorted by the ID column by default, which I want to keep. But I'd like to have the option to sort by Company Name as well by adding a Sort Button.
Here's the code for my Gallery:
SortByColumns(
Filter(Opportunities,
IsBlank(ComboBox2.SelectedItems) || IsEmpty(ComboBox2.SelectedItems) || Status in ComboBox2.SelectedItems,
IsBlank(ComboBox2_1.SelectedItems) || IsEmpty(ComboBox2_1.SelectedItems) || LookUp(Companies, ID = CompanyID, Country) in ComboBox2_1.SelectedItems,
CompanyID in Search(Companies, TextInputSearch_2.Text,"Name").ID),
"ID", Descending)
The column I want to sort by: LookUp(Companies, ID = ThisItem.CompanyID, Name).
It seems simple and I've tried so many different ways but I don't know what I'm doing wrong.
Any help would be appreciated. Thanks