cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
juresti
Level 8

Delegation limit solved - avoid delegation and get all joined records

 

How to avoid delegation issues and get all records?

 

The documentation is very clear in stating to not use functions or datasets that do not support delegation.

It is very hard though when you are trying to build apps that must use these certain functions specifically that do not support delegation.

 

I ran into this issue when I wanted to load all records and at the same time join a table.

As it turns out the functions for joining do not support delegation on the returned record set:

AddColumns, LookUp.

 

They support delegation when they look at the reocords but not when they return them to you, so you only get the limit specified in PowerApps setting.

 

I found the solution is to not use any of these functions and set the app setting to 1 record like their documentation specifies. If you only get one record this tells you do not use such function.

 

So this is how I get a gallery joined with another table and I'm able to see all records with my app setting set to 1.

 

1. Load the gallery with a single table with functions that have no delegation restrictions.

SortByColumns and Filter appear to be some of the few functions without restrictions.

 

SortByColumns(
Filter(Ops_Audits_Employees, createdon > DateAdd(Today(),-180, Days))
, "createdon", Descending)

 

1.PNG

 

All records show regardless of app setting. This means there are no delegation restrictions.

2.PNG

 

2. Join any related table data

Since we can't join the table data on the source, the best thing to do is join it in the gallery.

This allows us to work on one gallery record at a time therefore eliminating the worry of the delegation limits.

 

Add blank labels to your gallery where you will display the joined / related fields

 

Now simply display the value for the field related by your relationship column or field ID

 

Since we are only comparing on one gallery record at a time, delegation limits won't affect this "join / look up"

 

My related field text will display the following: 

Concat(Filter(Ops_Audits_Tables, Ops_Audits_Table = GUID(ThisItem.'Ops Audits Table ID')),jobType)

 

The value of the related field based on matching related ID

3.PNG

 

If you needed to update or delete any records you have easy access to the main table IDs and related table IDs.

 

So this gives you a solution to the most important part of any app - being able to see all your records with related tables and such.

 

3. Display all related records of a single parent table

This one is the same as using a Filter to display records based on related ID which does not require of any delegation restricted functions

 

It is simply the filer function .... example

Filter(Ops_Audits_SectionResults,
'Ops Audits Table ID' = glyAuditList_1.Selected.crf61_ops_audits_table_id
And employeeID = glyAuditList_1.Selected.crf61_employeeid)

 

I'm relating it on the selected gallery item.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Delegation limit solved - avoid delegation and get all joined records

Thanks @juresti. That's some very useful advice.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Delegation limit solved - avoid delegation and get all joined records

Thanks @juresti. That's some very useful advice.

View solution in original post

TopShelf-MSFT
Level 10

Re: Delegation limit solved - avoid delegation and get all joined records

Thanks so much for posting this @juresti 

 

@TopShelf-MSFT 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,555)