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

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
Highlighted
Dual Super User III
Dual Super User III

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!

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

Highlighted
Frequent Visitor

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

 
 
 
 

 

Highlighted
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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,477)