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
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!
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."
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
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."
User | Count |
---|---|
183 | |
123 | |
88 | |
45 | |
42 |
User | Count |
---|---|
250 | |
160 | |
125 | |
78 | |
73 |