Hi all, I am having some issues with filtering. I understand that when using SharePoint as a data source I can only use = Or StartsWith as delegable fields.
I am still receiving a delegation error when using starts with.
Here is the formula -
Filter(
'CRM Customer Portal',
If(
IsBlank(FilterTextName.Text),
false,
StartsWith(
'First Name' & Surname,
FilterTextName.Text
)
) && If(
IsBlank(FilterTextAddress.Text),
false,
StartsWith(
'Primary Address',
FilterTextAddress.Text
)
)
)
I am trying to have my gallery empty until somebody searches for a persons name or address. As there is 10000 records in the SharePoint List and I don't want to hinder the apps performance. Ideally I don't want to use = as I don't want people to have to type the entire address when searching.
Please let me know if I am doing something wrong?
Thank you very much, I have had a rethink and managed to think of a better way and no more delegation warning! Thank you for your help!
Hi @wardeee5
To avoid delegation error, you need to rethink your formula a little bit. Something like:
If(
IsBlank(FilterTextAddress.Text) || IsBlank(FilterTextName.Text),
Blank(),
Filter(
'CRM Customer Portal',
StartsWith(
'First Name',
FilterTextName.Text
)
&&
StartsWith(
'Primary Address',
FilterTextAddress.Text
)
)
)
Hope it helps !
Hi,
That is really helpful. So is my issue the IsBlank that is causing the delegation warning? In the Microsoft Document it has IsBlank as a non delegable field.
So to get around the warning should I just allow PowerApps to return the 500 records and then do the required filter? Instead of me wanting the gallery to be blank?
Non-delegable limits
Formulas that can't be delegated will be processed locally. This allows for the full breadth of the Power Apps formula language to be used. But at a price: all the data must be brought to the device first, which could involve retrieving a large amount of data over the network. That can take time, giving the impression that your app is slow or possibly crashed.
To avoid this, Power Apps imposes a limit on the amount of data that can be processed locally: 500 records by default. We chose this number so that you would still have complete access to small data sets and you would be able to refine your use of large data sets by seeing partial results.
You can read more about delegation warnings below
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview#delegation-warnings
Work around for the delegation warning is collecting the required data locally and then using the same collection as a data source instead of SharePoint list