Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Delegation issues with Month Filter

(0) ShareShare
ReportReport
Posted on by 7

I have an app that is used for building permits that I had built out of SharePoint. Inspectors can use the app to enter new permit forms or existing permits if the business already has some. The app uses a filter that uses dropdown menus to sort the permits by the Inspector, the status of the permit form (draft, submitted), month of inspection and year. The Month and Year are filter are from a Date column called inspection date. Some buisiness can apply for new permits months after the first one, so being able to pull up the orignial form to edit was needed.

 

Unfortuantely, I get a delegation warning on the Month part of the formula. Is there a workaround for this?  I was under the impression that the DateTime column was delagatable. I've increased the data row limit from 500 to 2000 in the meantime but will need to find a workaround for this as it's being heavily used now.

 

https://learn.microsoft.com/en-us/connectors/sharepointonline/#power-apps-delegable-functions-and-operations-for-sharepoint

 

delegation_warning.png

 

This is the forumla I am using on the gallery.

 

SortByColumns(Filter('Permit Form',Inspector.Value = InspectorDropdown.Selected.Value, Month('Date of Inspection')=MonthDropdown.Selected.ID, Year('Date of Inspection')=YearDropdown.Selected.Value,  Status.Value = StatusDropdown.Selected.Value, StartsWith(Business,SearchInput1.Text)),"Modified",SortOrder.Descending)
 
These are the drop down boxes that are used to filter the data. The first one is the inspector name.
permit_app.png
 
The onvisible property of the screen uses this formula to give each month an id in order to sort.
 
ClearCollect(collMonths, Table(
  { ID:1, Name:"Jan"}, { ID:2, Name:"Feb"}, { ID:3, Name:"Mar"},
  { ID:4, Name:"Apr"}, { ID:5, Name:"May"}, { ID:6, Name:"Jun"},
  { ID:7, Name:"Jul"}, { ID:8, Name:"Aug"}, { ID:9, Name:"Sep"},
  { ID:10, Name:"Oct"}, { ID:11, Name:"Nov"}, { ID:12, Name:"Dec"}
));

 

Any help would be greatly appreciated.

  • Verified answer
    WarrenBelz Profile Picture
    146,645 Most Valuable Professional on at
    Re: Delegation issues with Month Filter

    Hi @bclem ,

    The non-Delegable elements are the Month() and Year() conversion of the date column. The code below may not be a complete solution if the output of the top filter exceeds your Data Row Limit

    With(
     {
     _Data:
     SortByColumns(
     Filter(
     'Permit Form',
     Inspector.Value = InspectorDropdown.Selected.Value, 
     Status.Value = StatusDropdown.Selected.Value, 
     StartsWith(
     Business,SearchInput1.Text
     )
     ),
     "Modified",
     SortOrder.Descending
     )
     },
     Filter(
     _Data,
     Month('Date of Inspection') = MonthDropdown.Selected.ID, 
     Year('Date of Inspection') = YearDropdown.Selected.Value
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard