cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Delegation error

I have resolved quite a few delegation errors but this one I can't seem to figure out.

The items property in my gallery is:

 Search(
         Filter('Exception Tracker',SPOC = Me),
	TextInput1.Text,"SPOC")

Me is set on OnStart of the app as 

 

Set (Me,Office365Users.MyProfile().MailNickname)

SPOC is a text comun in my SP list.

 

Any help will be appreciated.

 

9 REPLIES 9
Advocate I
Advocate I

Hi, @Anonymous !

 

Have you tried using "in" instead of "="?

Filter('Exception Tracker',Me in SPOC)

 Let me know how it goes. 

 

Hope this helps! 🙂  

Anonymous
Not applicable

Hi @MRNBagtas ,

 

That didn't work. 

Initially the delegation error was in TextInput1.Text,"SPOC".

 

With  "in" the delegation error is on the "in" word.

Did you create index for column SPOC?

Regards,

Mick

Hi, @Anonymous !


I actually did the same scenario you have, but instead of an SP list, I used collection.

It worked fine for me using your PowerApps code without any delegation error. 

 

 

Anonymous
Not applicable

@Mickyw  I did, but still the error.

Hi @Anonymous 

 

I've just noticed that your delegation warning was underlining TextInput1.Text,"SPOC". In that case it refers to "Search" function (not Filter one) - which can not be delegated to Sharepoint list.

If your Filter is selective enough to never returns more then 2000 records - then you can save it temporarily to collection and search over it using Search.

Regards,

Mick

 

Anonymous
Not applicable

Hi @Mickyw ,

 

Thank you for that explanation. But I never faced this issue in my previous apps. While I used the same format 

for e.g. This one from one of the other apps works just fine.

SortByColumns(
    Search(
                 Filter(
                'Incident Tracker',
                Vertical = UsrVertical,
                Action_x0020_Plan_x0020_Status = "Incident Logged" 
            ),
        TextInput1.Text,
        "Impacted_x0020_Client"
    ),
    "Incident_x0020_Id",
    Descending
)

I started my current app with a replication of the same code, just changing the variable names but landed in error. SInce then I have been stripping down the code, removed sort, but no luck.

Anonymous
Not applicable

This is where I am in my current app. Delegation error still on search on the OHR field.

ortByColumns(
    Search(
    Filter('Exception Tracker',SPOC=Me),
    TextInput1.Text,"OHR"),
    "Date_x0020_of_x0020_Movement",Descending)

Any other ideas? My record count is expected to be more than 2000.

I agree this is mysterious how delegation warning is calculated. I have a impression it it sometimes false-positive.

For example this gives me delegation warning (SP list has only single text column)

Collect(
    testcol1;
    Search(
    Filter(
        delegation_test;
        Title = "2019-01-01"
    );
    "2019";
    "Title"
))

while this does not (find the difference 😉 😞

Collect(
    testcol1;
    Search(
    Filter(
        delegation_test;
        Title = "2019-01-01"
    ).Title;
    "2019";
    "Title"
))

 

In such and simillar cases it should help if you collect data from Filter into temporary collection and then search it in second call.

Regards,
Mick

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (32,108)