In Power Apps Canvas Apps only certain functions are delegable. If we use just one nondelegable function in our query, then the whole query won't be delegable. So, it is very important that we compose our query by carefully choosing delegable functions.
Delegable datasources are SharePoint, Microsoft Dataverse,,SQL Server
The above datasources are delegable. In case we work with the above datasources, we might need to face delegation.
As we know, Excel workbooks, collections, and tables are stored in Power Apps Canvas App, so for searching and filtering, we can use whatever function we wish to and the application does not require delegation.
Delegable functions are,
- And (including &&), Or (including ||), Not (including !)
- In
- =, <>, >=, <=, >, <
- +, –
- TrimEnds
- IsBlank
- StartsWith, EndsWith (these are very important functions, I use them very often)
- Constant values that are the same across all records, such as control properties and global and context variables.
Starts With
The function of the chosen field cannot be delegated. The person field is utilized with the StartsWith function. We must understand when these functions can be utilized because the StartsWith function also operates with single-line text fields and number fields.
Therefore, it is best to construct, say, a single line of text field adjacent to a choice field and update it in the same way that we would edit a choice field if we want to filter the field. The name of this field would be the [TECHNICAL] field, and its sole purpose would be filtering.
With(
{
_mgr: ManagerListFilter_MyTS.SelectedItems,
_week: WeeksListFilter_MyTS.Selected,
_month: ListMonthFilter_MyTS.Selected,
_proj: ProjectsListFilter_MyTS.Selected,
_wbs: WbsListFilter_MyTS.Selected
},
Sort(
Filter(
TimeEntries,
// Manager (single selection recommended for delegation)
IsEmpty(_mgr) || ManagerName = First(_mgr).Title,
// Week
IsBlank(_week) || Title = _week.Week,
// Month
IsBlank(_month) || Month = _month.MonthName,
// Project
IsBlank(_proj) || ProjectName = _proj.Value,
// WBS
IsBlank(_wbs) || WBS = _wbs.WBS
),
Modified,
SortOrder.Descending
)
)
✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.