cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kartik_PA
Frequent Visitor

Filter within collect causing delegation - Anyway to get around?

Hi, My source is sharepoint and I have a collection ColInspection that comes from Inspection SP List and looks like this:

ID (AKA InspectionID)InspectionStatusLocationIDInspector
100Scheduled1

John Doe

200Done2001

Jane Doe

 

The LocationID field above is tied to Location SP list which has 4000 records and has details of the location like this:

ID(AKA LocationID)LocationNameLocationAddress

LocationRegion

1Location1123 Main StreetNorth
2001Location2 789 Big StreetEast

 

Inspection SP list had almost all the columns from Location list too but as it was not a good design, I was attempting to change it so that they join on LocationID field to get the needed location attributes plus the inspection attributes into one collection called ColLocations that has these fields (InspectionID,InspectionStatus,LocationID,LocationName,LocationAddress, LocationRegion)and here is what I am doing.

 

The issue is, it works perfect as long as LocationID is < 2000 and once it is > 2000, those locations don't come into the collection anymore. I know that the issue is because of delegation but not sure how to solve it. The survey collection will be pretty small (10s of records )compared to the location list (4000 records ). 

 

Any workaround for this please?

 

 

Clear(colLocations);
    ForAll(
        RenameColumns(colInspection,"ID","SID"),
        Collect(
            colLocations,
            AddColumns(
                Filter(
                    ShowColumns(
                        Loations,
                        "ID",
                        "LocationAddress",
                        "LocationRegion",
                        "LocationName"
                    ),
                    ID = LocationID // This is causing Delegation issues
                ),
                "InspectionID",
                SID,
                "InspectionStatus",
                InspectionStatus
            )
        )
    );

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @WarrenBelz ,

 

Thanks for your quick reply. Though your concept for shadow id works for cases where there are more than just 2k(or what ever is the delegation limit is) needed to be pulled in from SP, in my case all I needed was just a handful of Location records for those locations that were in Inspection collection.

 

I figured that functions like ShowColumns, RenameColumns inside the filter/ lookup functions cause delegation issues (without the blue squiggly lines). I am not really sure why but happened to me multiple times now.

 

I was able to solve my issue just by removing the ShowColumns from my code.

 

Thank you.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User III
Super User III

Hi @Kartik_PA ,

Please have a read of this recent post of mine regarding a "shadow" ID field and then the ability to collect as many records as you need. Let me know if this would solve your issue.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @WarrenBelz ,

 

Thanks for your quick reply. Though your concept for shadow id works for cases where there are more than just 2k(or what ever is the delegation limit is) needed to be pulled in from SP, in my case all I needed was just a handful of Location records for those locations that were in Inspection collection.

 

I figured that functions like ShowColumns, RenameColumns inside the filter/ lookup functions cause delegation issues (without the blue squiggly lines). I am not really sure why but happened to me multiple times now.

 

I was able to solve my issue just by removing the ShowColumns from my code.

 

Thank you.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (52,128)