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

Delegation warning on Sharepoint

Hi everyone,

 

I am a beginner in powerapps and I have a question that I am unable to resolve.

 

I am developing an expense application, and I would like the finals users to be able to view the expenses that were sent:

uuuuu.png

Status Approval:

  • Open
  • Aprroved
  • Deny

I write the code to make it possible, an warning appears and I don't know how to overcome a situation:

ffffff.png

Is it possible to do that?

2 ACCEPTED SOLUTIONS

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @iagosalvadori 

 

Sum is not a delegable function.

List of delegable functions with respect to data source - 

CDS - https://docs.microsoft.com/en-us/connectors/commondataservice/

SharePoint - https://docs.microsoft.com/en-us/connectors/sharepointonline/

SQL - https://docs.microsoft.com/en-us/connectors/sql/

 

If you want to learn more about delegation:-

https://www.youtube.com/playlist?list=PLTyFh-qDKAiE6ia-D94Qk5-AzpN4dqOmD

 

 

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

 

View solution in original post

mdevaney
Super User
Super User

@RezaDorrani 

An alternate approach without Flow might be to store the totals for each user in a SharePoint list.

 

UserEmail Abertas Aprovadas Recusadas
dsmith@xyz.com 233 655 435
fcole@xyz.com 3565 435 543
jgreen@xyz.com 3456 5435 636

 

Then each time an action is taken: Abertas, Aprovadas, Recusadas you could PATCH to update the totals.  Do you think this technique might work here?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up”

View solution in original post

10 REPLIES 10
RezaDorrani
Dual Super User II
Dual Super User II

Hi @iagosalvadori 

 

Sum is not a delegable function.

List of delegable functions with respect to data source - 

CDS - https://docs.microsoft.com/en-us/connectors/commondataservice/

SharePoint - https://docs.microsoft.com/en-us/connectors/sharepointonline/

SQL - https://docs.microsoft.com/en-us/connectors/sql/

 

If you want to learn more about delegation:-

https://www.youtube.com/playlist?list=PLTyFh-qDKAiE6ia-D94Qk5-AzpN4dqOmD

 

 

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

 

View solution in original post

mdevaney
Super User
Super User

@iagosalvadori 

The SUM function cannot be delegated in SharePoint.  Please see below for a list of formulas that can be delegated.

 

One simple thing you can do is go to the advanced settings and increase your delegation limit to 2,000 rows.  Other than that you would have to write some code that would store the totals for each user in SharePoint beside their userid/email.

 


SharepointDelegation.png

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thank you @RezaDorrani 

 

I´ll try to find a solution without using the sum fuction. 

@iagosalvadori 

 

One option is to call a flow to do the calculation and return the value to Power Apps.

Adv: Real time

Disadv: Will require a flow run for every user request

 

Another option is to periodically run a flow to perform calculations and update a list where totals are maintained. Power Apps can then read data from this list. (not real time)

Adv: Flows run on a defined schedule

Disadv: Not real time

 

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

mdevaney
Super User
Super User

@RezaDorrani 

An alternate approach without Flow might be to store the totals for each user in a SharePoint list.

 

UserEmail Abertas Aprovadas Recusadas
dsmith@xyz.com 233 655 435
fcole@xyz.com 3565 435 543
jgreen@xyz.com 3456 5435 636

 

Then each time an action is taken: Abertas, Aprovadas, Recusadas you could PATCH to update the totals.  Do you think this technique might work here?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up”

View solution in original post

Hi @mdevaney 

 

In case of a user based total scenario - Yes.

But I feel it looks like too much work and a better workaround would be to use flow.

 

However in case of a user based scenario. As max delegation limit is 2000.

First one should filter all results for a specific user which would reduce the data set retrieved. ( Assuming no user has more than 2000 items returned based on the filter). Then the Sum function delegation warning would yield accurate results.

 

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

Hi @mdevaney 

 

Yes, maybe.

 

But the status is updated as the flow progresses ... Where should the PATCH command be? In the flow or in the app?

@RezaDorrani 

 

The second option was ideal, but I don't know how to do it yet...

 

I'll check how I can create this flow to keep this list up to date.

 

Thank you

 @RezaDorrani 

Thanks for the additional discussion on this topic.  I agree, Flow would be less work to implement in this scenario.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,621)