Hello
I have created a gallery (GalleryRequestList) in a canvas app that shows a list of records from a Dataverse table (RequestList). The table contains a Lookup column so that rows can be assigned to users based on their Active Directory user ID. This lookup column in the RequestList table is called AssignedTo and references the AAD User table.
There are several sorting and filtering criteria that must be applied to the gallery. The high-level code for the Items property of the gallery is below.
The issue I have is the presence of the in, Or, and || functions triggers a delegation warning.
How can I adjust this code so that the gallery can be filtered by (distinct) AAD user ID in a delegable function?
ddAssignedTo (AAD User ID dropdown) [Items property]:
Distinct(RequestList,AssignedTo.'Display Name')
GalleryRequestList [Items property]:
SortByColumns(
Filter(
Search(
RequestList,
InpSearchBar.Text,
"column1",
"column2"
),
And(
FaxReceived>DateTimeValue(Month(DatePickerFrom.SelectedDate) & "/" & Day(DatePickerFrom.SelectedDate) & "/" & Year(DatePickerFrom.SelectedDate) &" " & DropdownReceivedFromHours.SelectedText.Value & ":"& DropdownReceivedFromMinutes.SelectedText.Value,"en-AU"),
FaxReceived<DateTimeValue(Month(DatePickerTo.SelectedDate) & "/" & Day(DatePickerTo.SelectedDate) & "/" & Year(DatePickerTo.SelectedDate) &" " & DropdownReceivedToHours.SelectedText.Value & ":"& DropdownReceivedToMinutes.SelectedText.Value,"en-AU")
),
AssignedTo.'Display Name' in ddAssignedTo.SelectedText.Value Or IsBlank(ddAssignedTo.SelectedText.Value) || IsEmpty(ddAssignedTo.SelectedText.Value)
),
"cr000_receiveddate",If(
ctxSortDescending,
Ascending,
Descending)
)