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

Filter Gallery from sharepoint list with lookup column based on combobox - delegation warning

Hi community,

I already searched some time for my problem, but cant find a proper solution. Maybe It is out there and I havnt found it yet. If so I would really appreciate it, if you'd paste the link here. 

If I'm really the first one with that specific problem (what I doubt) I would appreciate your help to bring me an understanding and maybe solution:

 

I'm builiding a PowerApp for our Project management.

I have one sharepoint list named "Projekte" with several text, number, date and also lookup columns. None of those columns are multiple select.

One of those lookup column is the column for "Status" -> "[1] Nicht begonnen", "[2] Geplant", ...

Those options are in the list "Projektstatus" on the same sharepoint. These options are in the column "Title" with type "One text line".

 

I put those 2 SP Lists in my App datasources .

In my App I have a Gallery with the SP list "Projekte" as datasource.

 

I also have a combobox "drp_status" on the same screen as the gallery. Items for that combobox is 

 

 

Projektstatus.Title

 

 

 

I now want to filter the gallery based on the selected combobox items.

Im able to do so, but receive a delegation warning

 

Here the filter for the Gallery Items:

 

 

Filter(
    Projekte;
    If(
        IsBlank(drp_status.Selected.Title);
        true;
        Status.Value in drp_status.SelectedItems.Title
    )
)

 

 

I wouldnt mind, if we would have under 2000 projects, but unfortunately we are a big company and even little tasks can be projects. So we'll reach 2000 projects within 1-2 years.

Can somebody help me here?

 

 Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
PowerUser01
Frequent Visitor

Hello @WiZey @RandyHayes ,

so I checked the collect method and pre-filtering, but that wont work for my scenario.

After punishing google again, I found this solution:

https://youtu.be/Wr42PeW6_wU?t=367

 

Thats exactly what I was looking for.

Regardless, thank you very much for your support and to keep the community up.

View solution in original post

6 REPLIES 6
WiZey
Super User
Super User

Hello @PowerUser01 ,

 

I'm guessing you have a delegation warning because you've put a "If()" statement in the "Filter()". 

 

My advice is collecting the SharePoint list in a collection, then work on that collection.

 

"Collect()" is more than able to retrieve 2000+ items from your list, and using "Filter()" on a collection allows you to evade the delegation warning.

 

Hope this was helpful to you.

RandyHayes
Super User
Super User

@PowerUser01 

Since you are using the in operator (which is not delegable), you will need to consider your record limits.

If you expect more than 2000, then the first question is - do you need to display 2000 or more records to the user?  If not, then what is the criteria that would limit the number of records to only relevant records?

Things like - if the project is "closed", can it be excluded and thus limit the number of records to work with?  Or perhaps a date restriction for your record results - perhaps only the past 3 months of projects or something like that?

 

These are all what I refer to as "pre-filtering" - if you can establish a pre-filter then your formula to filter (although needs an adjustment) can still use the in operator without delegation concerns.

 

Does any of the above apply in your scenario?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello @WiZey 

Thank you very much for your input. 

I read that method with "Collect()" quite often, but have to admit, that I'm not that firm with it.

I tried to avoid that, because as far as I know, I'd not work with "life" data then.

What happens, if somebody else edits a record, which I want to edit. But due to my "local" dataset, I dont see his changes?

Maybe I understood that wrong.

Seems as I need to learn exactly whats behind "Collect()".

Hello @RandyHayes 

Thank you very much for your input.

Thats exactly what I want to achive.

I have a very big dataset (list) and want to filter out, what I dont want to see.

The "Status" is only one row I  want to filter (but with that I want to start).

The user should be able to filter potential every row from that list.

 

What do you meen with "pre-filter"?

Should the filter be cascaded? Do I generate after every filter step a new dataset?

WiZey
Super User
Super User

Before changing a record, SharePoint list compare the record's last updated date. This is a security to avoid many users to change the same record.

 

At worst you will get an error pop-up that ask you to reload the data with the latest update.

PowerUser01
Frequent Visitor

Hello @WiZey @RandyHayes ,

so I checked the collect method and pre-filtering, but that wont work for my scenario.

After punishing google again, I found this solution:

https://youtu.be/Wr42PeW6_wU?t=367

 

Thats exactly what I was looking for.

Regardless, thank you very much for your support and to keep the community up.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,045)