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 Apps
Answered

Delegation Issues

(0) ShareShare
ReportReport
Posted on by 36

Hello, I have created an APP for checking & reporting of Car Milage twice a day by 50+ staff members. After running the app for almost 6 months, the number of rows of the SP List is now over 4,400.

I've set a delegation at my APP for retrieving only those records in the past 5 days with the formula below but it however doesn't work!!!

If(
    IsBlank( TextSearchBox1.Text),
    SortByColumns(
        Filter(
            'Company Vehicle Milage Records',
            'Technician Name' = Office365Users.MyProfileV2().displayName &&
            DateValue('Report Date') >= DateAdd(Today(), -5)
        ),
        "ID", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)
    ),
    SortByColumns(
        Filter(
            'Company Vehicle Milage Records',
            Switch(
                ComboBox1.Selected.Val,
                1, TextSearchBox1.Text in 'Technician Name',
                2, TextSearchBox1.Text in 'Car Plate Number',
                3, TextSearchBox1.Text in Area
            ) &&
            DateValue('Report Date') >= DateAdd(Today(), -5)
        ),
        "ID", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)
    )
)


Much appreciate your advice on making this formula functionable.

Thanks

Raymond

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,685 Super User 2024 Season 1 on at

    @Raymondwkmok - the key issue you have here is that your Filter operation is still not delegable because a cast operation like DateValue is a server side operation which can only be applied to the first 500 records in your data source (or max 2000 if changed via settings).

     

    Unless you have any other delegable criteria you can filter on, a fast and alternative option is apply your Filters in Power Automate and then return the filtered data back to your Power App using the Respond to a Power App or flow action.

  • timl Profile Picture
    36,682 Super User 2026 Season 1 on at

    @Raymondwkmok - in addition to what @Amik says, I also note that Switch part of your formula applies the 'in' operator. This will be another reason why your formula isn't delegable. 

  • RM-06090351-0 Profile Picture
    36 on at

    Thanks Amik for the advice.

    Btw, please can you provide further details or guidance on how I can apply filters in Power Automate and then return the filtered data back to your Power App using the Respond to a Power App or flow action.

    Many Thanks
    Raymond

  • Ami K Profile Picture
    15,685 Super User 2024 Season 1 on at

    @Raymondwkmok this topic is too broad for a forum post and there are many resources you can find online on this action (or alternatively use the Response action if you have premium).

     

    The basic steps are:

     

    1. Create a flow (such as an Instant Cloud Flow)

    2. Select a trigger, e.g. Power Apps v2

    3. Insert a Get Items action and configure the Site Address and List Name

    4. In the ODATA filter function, apply your filter parameters

    5. Add a "Respond to a Power App or flow action"

    6. Select Text for Output

    6. Enter a title

    7. For "enter a value to respond", select "value" from Dynamic Content from the Get Items action

    7. Run a manual test to ensure a valid response is being returned

    8. Return to your Canvas App and add the Power Automate flow into the App

    9. Trigger the Flow, for example by creating a Button control and on the OnSelect property of the Button, use:

     

    Set(
    powerautomate_response, 
    'Your Flow Name'.Run("some parameter")
    )

     

    10. The data will be returned back to your Canvas App as a JSON string. You will then need to leverage the Parse JSON function to obtain the table structure you need.

     

    Further reading:

     

    https://www.youtube.com/watch?v=FqfLiJDdC3Q&t=712s 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard