cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PowerTomas
Level: Powered On

Workaround for Delegation warning in

Hey Team!

 

I have a Solutions with 2 sharepoint lists and i want to create a report with it inside powerapps.

 

If(Toggle2.Value,
ClearCollect
(SubjectCollect,
Filter(Subject,
Company = CompanyDD_1.SelectedText.Value;
ClearCollect(ActivitiesCollect, Filter(Activities, MasterID in SubjectGallery.AllItems.ID))

 

And my question is , why cant I use = , instead of in operator? I have tried so many ways and i cant find a solution to get all acticites without to have a delegation warning.

 

My warning text is just "Invalid argument". But both fields are numbers

Any solutions?

 

Best regards

Tomas

4 REPLIES 4
Dual Super User
Dual Super User

Re: Workaround for Delegation warning in

Hi @PowerTomas 

 

Can you try to update the expression to:

If(Toggle2.Value,
ClearCollect
(SubjectCollect,
Filter(Subject,
Company = CompanyDD_1.Selected.Value;
ClearCollect(ActivitiesCollect, Filter(Activities, MasterID in SubjectGallery.AllItems.ID))

Also, regarding SubjectGallery.AllItems.ID, this returns a one column table of all the ID in Gallery control. So = will give an incompatible error and in operator is used to look for a value in a list.

In case you want to compare MasterID with the selecteditem ID, then the expression should be:

If(Toggle2.Value,
ClearCollect
(SubjectCollect,
Filter(Subject,
Company = CompanyDD_1.Selected.Value;
ClearCollect(ActivitiesCollect, Filter(Activities, MasterID = SubjectGallery.Selected.ID))

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Super User
Super User

Re: Workaround for Delegation warning in

@PowerTomas 

Your code currently looks like this.  Its missing a few brackets and there's a semi-colon where I think an end-bracket should be.  This is likely the cause of your invalid argument.

If(
    Toggle2.Value,
    ClearCollect(
        SubjectCollect,
        Filter(
            Subject,
            Company = CompanyDD_1.SelectedText.Value;
            ClearCollect(
                ActivitiesCollect,
                 Filter(
                     Activities,
                     MasterID in SubjectGallery.AllItems.ID
                 )
            )

 

That being said, what are you trying to do here?  Are you trying to create 2 collections when the Toggle is TRUE?

 

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

PowerTomas
Level: Powered On

Re: Workaround for Delegation warning in

Hey @mdevaney 

 

My code is working fine. But I have a delegation warning because of the in operator.

 

ClearCollect

(Activitiescollection,

Filter

(Activities,

MasterID in Subjectcollection.ID))

 

My problem is that my Sharepointlist that contains activities is going to be larger than 2000 records.

 

I want to hade two gallerys 

1. Gallery1 With all the subjects from my main sharepoint list depends on my selection from company dropdown.

2. And my second gallery is for activities with the same "MasterID" as Gallery1 ID.  

But i want to do this without having a delegation warning.

 

So is there a way to accomplish this code without using in operator.

Simply i want my second gallery filtering on the items in the maingallery without having a delegation warning.

And my work to link them between is having the same MasterID as ID.

 

If(
    Toggle2.Value,
    ClearCollect(
        SubjectCollect,
        Filter(
            Subject,
            Company = CompanyDD_1.SelectedText.Value;
            ClearCollect(
                ActivitiesCollect,
                 Filter(
                     Activities,
                     MasterID in SubjectGallery.AllItems.ID
                 )
            )
 

The toggeling is just for having another filter when im clearcollecting.

 

Best regards

Tomas

 
 
 
 

 

Super User
Super User

Re: Workaround for Delegation warning in

@PowerTomas 

You are correct that the IN operator definitely cannot be used.  For ideas on how to fix it see the response of @yashag2255 above.

https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/

 

Using CLEARCOLLECT inside of a FILTER would be problematic too.  The CLEARCOLLECT has nothing to do with the FILTER, its not being referenced at all.  Why not move this outside of the FILTER and do it separately?

 

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

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,423)