cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rudy_Digital
Helper I
Helper I

Delegation Warning Issues

Hello everyone, i'm facing some delegation issues in my app.
I tried various t osolved the problem by following various videos but couldn't make it through.

Below are the 2 problems i'm facing:

Rudy_Digital_0-1620649499624.png

Thanks loads for helping 🙂

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User III
Super User III

@Rudy_Digital 

You can consider changing your formulas to the following to remove the delegation warning.

With({_itms: Filter('Shipment Request', 'Shipment Status'= "Shipment Requested")},
    CountRows(_itms)
)

The Filter statement is delegable and it is assigned to a With Scoped variable.  CountRows will not experience delegation issues with a local table.

 

Do the same for the the remaining.

 

Another consideration is to look to the Items property of your Gallery - I am assuming the 4 statuses are in a horizontal gallery, if not, I would consider using a gallery instead of separate labels and icons.

Then, your items property can be the following:

   GroupBy('Shipment Request', "Shipment Status", "_recs")

Your title Label would then become : ThisItem.'Shipment Status'

Your count label would then become : CountRows(ThisItem._recs)

 

As for the bottom formula. Your formula is "technically" delegable.  The editor will provide this warning though.

You can avoid it with the following formula replacement:

With({_itms: Sort('Shipment Request', Title, Descending)},
   Value(First(_itms).Title) + 1
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Rudy_Digital
Helper I
Helper I

@RandyHayes 
For the Problem 1, i used your solution and it worked perfectly fine. Thanks 🙂

Problem 2 i used this formula:

If(Form1.Mode=FormMode.New,Last('Shipment Request').Title+1,ThisItem.Title), it is working without delegation issue.

Thanks a lot 🙂 

View solution in original post

5 REPLIES 5
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Rudy_Digital 

 

Count is not a delegable function. You would need to take help of flow.

Check Power Apps Delegation - Working with Large Data Sources - YouTube

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

Rudy_Digital
Helper I
Helper I

Hello,

 

@JR-BejeweledOne

@JB0007;

@RandyHayes 

Could you guys please me sort out this issue?

Thanks loads 🙂 

JR-BejeweledOne
Super User
Super User

Unfortunately you will always get delegation warnings when using a First function.   Count is only delegable when Dataverse (CDS) is your data source and you have to turn it on in advanced functions.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-counts

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-first-last

 

If you haven't watched the video in Reza's answer, you should.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
RandyHayes
Super User III
Super User III

@Rudy_Digital 

You can consider changing your formulas to the following to remove the delegation warning.

With({_itms: Filter('Shipment Request', 'Shipment Status'= "Shipment Requested")},
    CountRows(_itms)
)

The Filter statement is delegable and it is assigned to a With Scoped variable.  CountRows will not experience delegation issues with a local table.

 

Do the same for the the remaining.

 

Another consideration is to look to the Items property of your Gallery - I am assuming the 4 statuses are in a horizontal gallery, if not, I would consider using a gallery instead of separate labels and icons.

Then, your items property can be the following:

   GroupBy('Shipment Request', "Shipment Status", "_recs")

Your title Label would then become : ThisItem.'Shipment Status'

Your count label would then become : CountRows(ThisItem._recs)

 

As for the bottom formula. Your formula is "technically" delegable.  The editor will provide this warning though.

You can avoid it with the following formula replacement:

With({_itms: Sort('Shipment Request', Title, Descending)},
   Value(First(_itms).Title) + 1
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Rudy_Digital
Helper I
Helper I

@RandyHayes 
For the Problem 1, i used your solution and it worked perfectly fine. Thanks 🙂

Problem 2 i used this formula:

If(Form1.Mode=FormMode.New,Last('Shipment Request').Title+1,ThisItem.Title), it is working without delegation issue.

Thanks a lot 🙂 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,221)