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

Best Practices to avoid delegation (addcolumns function tip)

Hi guys,

 

I have some questions about the best practices to avoid delegation using dataverse lookup columns. Cause when I have a relationship between two tables and wanna filter in a gallery by id, the app is giving me delegation problem.

 

So, I learned a time ago, one thing that helps me to avoid the delegation alert likes add a AddColumns function (Solved: Filtering a gallery based on a second level relati... - Power Platform Community (microsoft....) and all my apps i used this.

 

But, I made some tests decreasing the delegation row limits and I noticed that the delegation problem continue, but the app don't show me message error.

 

Someone can test this and confirm to me, please? And if is correct, is there some way to know all place of my app that having this problem, like using monitor or debugging?

Pinguito_0-1623442488404.png

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Super User
Super User

@Pinguito If you have a relationship in Dataverse, you don't need to do a Filter etc., To get the related records, you can use the dot (.) notation.

In my example I have a 1:N relationship between Events and EventAttendance.

I have a Gallery which lists all the Events and another gallery which lists all the EventAttendance for the selected Event in the the 1st Gallery. The Items property in the 2nd Gallery is: Gallery1.Selected.EventAttendance

This fetches all the records and I don't see any delegation warning either.

 

Hope this is helpful!

View solution in original post

18 REPLIES 18
CNT
Super User
Super User

@Pinguito If you have a relationship in Dataverse, you don't need to do a Filter etc., To get the related records, you can use the dot (.) notation.

In my example I have a 1:N relationship between Events and EventAttendance.

I have a Gallery which lists all the Events and another gallery which lists all the EventAttendance for the selected Event in the the 1st Gallery. The Items property in the 2nd Gallery is: Gallery1.Selected.EventAttendance

This fetches all the records and I don't see any delegation warning either.

 

Hope this is helpful!

View solution in original post

@CNT thank you for your answer, I never did use this method, thanks for the learn.

 

I tried to apply in my app but gives me delegation warn

 

Pinguito_0-1623675647901.png

 

@Pinguito Ar you getting the delegation warning without the Sum?

If I set Gallery1.Selected.EventAttendance in the 2nd Gallery and apply sum function to Gallery2.AllItems I think I don't have delegation problem but it makes me dependent on a Gallery, right? I would like to get this data without create Galleries. Is that possible?

@Pinguito You don't need a Gallery, just use the With function,

 

With(
	{varDespesas: Gallery6.Selected.Despesas};
	Sum(varDespesas; Valor)
)

 

@CNT yeah perfectly! now the problem is the result not showing in label. Below, the total sum is 323, but in my label is giving me zero

 

Pinguito_0-1623680367374.png

 

@Pinguito Either you can put that formula directly in the Text property of the Label or use a variable like,

 

Set(gblSum,With(
	{varDespesas: Gallery6.Selected.Despesas};
	Sum(varDespesas; Valor)
))

 and set the Text property of the Label to gblSum.

 

I tried both of them, but isn't correct in my app, I don't know why.

 

Message using variable: "Behavior function in a non-behavioral property. You cannot use this property to change values elsewhere in the app. "

 

Pinguito_0-1623680823731.png


Set the text property: the result is blank

I'm sorry. I was putting on Set Function in text property.

 

I fix the property to OnSelect of a button, but the result is blank too.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn 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.

Top Solution Authors
Top Kudoed Authors
Users online (1,587)