Morning all,
I've got a gallery that can be filtered by starting letter by using a dropdown. See below:
The "All" dropdown is the filter. It contains "All" and every letter of the alphabet. The gallery is set to show those entries with the selected starting letter, or to show all entries if "All" is selected. The code looks like this:
If(Dropdown1.Selected.Value = "ALL",
Sort(Filter(
'Lookup - Units',
'Academic Year' = 'Admin AER - Dropdown - AY_1'.Selected.'Academic Year',
Department = 'Admin AER - Dropdown - Dept_1'.Selected.Department),
'Unit Title',
Ascending),
Sort(Filter(
'Lookup - Units',
'Academic Year' = 'Admin AER - Dropdown - AY_1'.Selected.'Academic Year',
Department = 'Admin AER - Dropdown - Dept_1'.Selected.Department,
StartsWith('Unit Title',Dropdown1.Selected.Value)),
'Unit Title',
Ascending))
However, a few entries begin with numbers, and I would like to be able to filter on those, using a "#" sign. I can easily add this into the dropdown, but can't make the the gallery filter appropriately.
In short, I need the gallery to detect if the first letter is a number and filter by that when "#" is selected from the dropdown. I would imagine it would look something like this, but I can't get it to work:
If(Dropdown1.Selected.Value = "ALL",
Sort(Filter(
'Lookup - AHUnits',
'Academic Year' = 'Admin AER - Dropdown - AY_1'.Selected.'Academic Year',
Department = 'Admin AER - Dropdown - Dept_1'.Selected.Department),
'Unit Title',
Ascending),
If(Dropdown1.Selected.Value = "#",
Sort(Filter(
'Lookup - AHUnits',
'Academic Year' = 'Admin AER - Dropdown - AY_1'.Selected.'Academic Year',
Department = 'Admin AER - Dropdown - Dept_1'.Selected.Department,
IsNumeric(Left('Unit Title',1))),
'Unit Title',
Ascending),
Sort(Filter(
'Lookup - AHUnits',
'Academic Year' = 'Admin AER - Dropdown - AY_1'.Selected.'Academic Year',
Department = 'Admin AER - Dropdown - Dept_1'.Selected.Department,
StartsWith('Unit Title',Dropdown1.Selected.Value)),
'Unit Title',
Ascending))))
Cheers!