We are filtering a Sharepoint List and delegation doesn't appear to be working in a specific scenario.
The difference is the addition of a switch statement to choose a connection to use.
Any ideas how to help resolve this, either fix the formula or another approach to solve for this use case?
This works and delegation is ok
OnStart
Set(MainConnectionNumber, RandBetween(0, 2))
Gallery.Items
Filter(
Sort(
'Sp List',
CustomerName
),
StartsWith(CustomerName, txt_FilterText.Text)
)
This works but no delegation
OnStart
Set(MainConnectionNumber, RandBetween(0, 2))
Gallery.Items
Filter(
Sort(
Switch(ConnectionNumber,
0, 'Sp List',
1, 'Sp List_1',
2, 'Sp List_2'
),
CustomerName
),
StartsWith(CustomerName, txt_FilterText.Text)
)
Solved! Go to Solution.
Hi @doingthings,
By reordering the nesting you can remove the switch from the filter:
OnStart
Set(MainConnectionNumber, RandBetween(0, 2))
Gallery.Items
Sort(
Switch(ConnectionNumber,
0, Filter('Sp List', StartsWith(CustomerName, txt_FilterText.Text)),
1, Filter('Sp List_1', StartsWith(CustomerName, txt_FilterText.Text)),
2, Filter('Sp List_2', StartsWith(CustomerName, txt_FilterText.Text))
),
CustomerName
)
Hi @doingthings,
By reordering the nesting you can remove the switch from the filter:
OnStart
Set(MainConnectionNumber, RandBetween(0, 2))
Gallery.Items
Sort(
Switch(ConnectionNumber,
0, Filter('Sp List', StartsWith(CustomerName, txt_FilterText.Text)),
1, Filter('Sp List_1', StartsWith(CustomerName, txt_FilterText.Text)),
2, Filter('Sp List_2', StartsWith(CustomerName, txt_FilterText.Text))
),
CustomerName
)