web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Delegation warning whe...
Power Apps
Answered

Delegation warning when filtering gallery on AAD dropdown user ID

(0) ShareShare
ReportReport
Posted on by

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)
)

 

Categories:
  • 365-Assist Profile Picture
    2,327 Moderator on at

    The way I like to remove these delegation warnings is by creating a Collection (In the App -> OnStart) for the data to be stored in. Then filter on the Collection (Rather than directly reading from the Data Source).

     

    --------------------------------------------------
    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    Subscribe: https://www.youtube.com/channel/UCFpvUlpx84FuIPOdInGKMTw
    Twitter: https://twitter.com/assist_365

    Regards
    Darren Lutchner - 365 Assist

     

  • Verified answer
    WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @pa111 ,

    You have Delegation issues all through that code, but to answer your first question, the below will work if the middle Filter (wList) which is Delegable in itself returns output under your Delegation limit (the list can be any size). NOTE - I have also assumed here that the display name will equal the dropdown value (you need = , not in)

    With(
     {
     wFrom:
     DateTimeValue(
     Month(DatePickerFrom.SelectedDate) & "/" & 
     Day(DatePickerFrom.SelectedDate) & "/" & 
     Year(DatePickerFrom.SelectedDate) & " " & 
     DropdownReceivedFromHours.Selected.Value & ":" & 
     DropdownReceivedFromMinutes.Selected.Value,
    		 "en-AU"
     ), 
    	 wTo:
    	 DateTimeValue(
     Month(DatePickerTo.SelectedDate) & "/" & 
     Day(DatePickerTo.SelectedDate) & "/" & 
     Year(DatePickerTo.SelectedDate) & " " & 
     DropdownReceivedToHours.Selected.Value & ":" & 
     DropdownReceivedToMinutes.Selected.Value,
     "en-AU"
     )
     },
     With(
     {
     wList:
     Filter(
     RequestList,
     (
     Len(ddAssignedTo.Selected.Value) = 0 || 
     AssignedTo.'Display Name' = ddAssignedTo.Selected.Value
     ) &&
     FaxReceived > wFrom && FaxReceived < wTo
     )
     },
     SortByColumns(
    	 Search(
     wList,
     InpSearchBar.Text,
     "column1",
     "column2"
     ),
     "cr000_receiveddate",
     If(
     ctxSortDescending,
     Ascending,
     Descending
     )
     )
     )
    )

    To your next question, the filter is not an issue, but rather getting all the items into the drop-down as Distinct() is not Delegable. How many items are in the list ?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @pa111 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • pa111 Profile Picture
    on at

    Thanks for your help with this!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard