Hi everyone.
I have a gallery that I'd like to filter by multiple columns (in their different combinations), thus I have several input controls.
The Items property of the gallery looks like this:
Sort(
If(Not(IsBlank(Emp.Text)) && Not(IsBlank(Con.Text)) && IsBlank(Dep.Text) && _selectedCount=2 && wm_1_filter =1,
Filter('[dbo].[welcome_meetings_view]','Start Date'>=sel_start.SelectedDate && 'Start Date'<=sel_end.SelectedDate && Emp.Text in Employee && Con.Text in country && wm_date_1<>Blank()),
If(
IsBlank(Emp.Text) && IsBlank(Con.Text) && IsBlank(Dep.Text) && _selectedCount<1 && wm_1_filter =0,
'[dbo].[welcome_meetings_view]',
If(Not(IsBlank(Emp.Text)) && IsBlank(Con.Text) && IsBlank(Dep.Text) && _selectedCount<1 && wm_1_filter =0,
Search('[dbo].[welcome_meetings_view]', Emp.Text, "Employee"),
...............some more IFs....................
)))))))),
'Start Date',SortOrder.Ascending)
At some point I started getting an error: Expression nested too deep. An expression in your formula is nested more than 50 levels.
Is there a chance to avoid this error or to filter the gallery another way? Thanks in advance.
Solved! Go to Solution.
Hard to tell without the complete formula.
In general, you should have 1 table returning function in your formula. Use the criteria of the Filter to base your logic. Lot's of If's in an Items formula will lead to pain.
Ex.
Sort(
Filter('[dbo].[welcome_meetings_view]',
(IsBlank(Emp.Text) || Emp.Text in Employee) &&
(IsBlank(Con.Text) || Con.Text in country) &&
(wm_date_1 = If(wm_1_filter=1, Blank(), "somethingElse")) &&
etc...
),
'Start Date', Ascending
)
I hope this is helpful for you.
Hard to tell without the complete formula.
In general, you should have 1 table returning function in your formula. Use the criteria of the Filter to base your logic. Lot's of If's in an Items formula will lead to pain.
Ex.
Sort(
Filter('[dbo].[welcome_meetings_view]',
(IsBlank(Emp.Text) || Emp.Text in Employee) &&
(IsBlank(Con.Text) || Con.Text in country) &&
(wm_date_1 = If(wm_1_filter=1, Blank(), "somethingElse")) &&
etc...
),
'Start Date', Ascending
)
I hope this is helpful for you.
User | Count |
---|---|
196 | |
122 | |
88 | |
49 | |
41 |
User | Count |
---|---|
285 | |
162 | |
138 | |
77 | |
73 |