cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KUNGFUPANDA559
Helper II
Helper II

500 Row Limit for Lookup function?

I was under the impression the lookup function was delegable.  I have a formula that populates the item field of a displayform.  However, it only works for the first 500 rows.  

 

If(Len(tSS_2.Text)=9,Set(itemRecord,LookUp(dataSourceRead,UNIQUE_ID=tSS_2.Text)),
Set(itemRecord, LookUp(dataSourceRead,BADGE=Value(tSS_2.Text))))

Thoughts?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I found my solution.  In the event you're struggling the following worked for me:

 

Button Press

 

Set(dataSource,Filter(dataSourceRead,unique_id=id))

Form Item property:

 

first(datasource)

Form Datasource

 

datasource

View solution in original post

5 REPLIES 5
Jeff_Thorpe
Super User
Super User

The lookup function is delegable but the Value() is not. You should see a blue squiggly line by that the Value() function.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
v-siky-msft
Community Support
Community Support

Hi @KUNGFUPANDA559 ,

What is your data source? Can you share the delegation warning details?

How many rows does data source have?

 

I have made a test (based on Sharepoint, more than 500 items), and don’t have the delegation issue you mentioned.

As the image shown, the 512th record can be looked up.

Annotation 2019-08-22 131214.png

By the way, the lookup function , the operator ‘=’, and the data source are all the factors that can’t be delegated.

So please post your data source and delegation warning details to make an accurate judgment.

 

If you want to overcome the 500 items limitation, you can refer to following:

  1. Increase the total limit items from 500 to 2000(Max) if the amount of record is under 2000.

Click file (top left corner) > App settings > Advanced settings > set value for non-delegable queries.

  1. If the amount of record is more than 2000, create collection to store the data, and use collection in your formula instead of the current data source.
  • Set the OnStart property of the App control as below:

Note: assume the amount of datasource is 6000, and have the primary identify type column “ID”.

Concurrent(
    ClearCollect(VarCollection1, Filter(dataSourceRead, ID >= 1 && ID <= 2000)),
    ClearCollect(VarCollection2, Filter(dataSourceRead, ID >= 2001 && ID <= 4000)),
    ClearCollect(VarCollection 3, Filter(dataSourceRead , ID >= 4001 && ID <= 6000)),
    );
ClearCollect( VarCollection, VarCollection 1, VarCollection 2, VarCollection 3)

Tips: If you don’t know the amount of datasource, you can check this:

UpdateContext({firstrecord: First(datasource)});
UpdateContext({lastrecord: First(Sort(datasource, ID, Descending))});
Amount= lastrecord.ID - firstrecord.ID
  • Modify your formula as below:
If(Len(tSS_2.Text)=9,Set(itemRecord,LookUp(VarCollection,UNIQUE_ID=tSS_2.Text)), Set(itemRecord, LookUp(VarCollection ,BADGE=Value(tSS_2.Text))))

Please have a try with above workaround, and check if the issue is solved.

 

Best regards,

Sik

@v-siky-msft I'm using Azure SQL.   Shouldn't i be able to filter the datasource using the conditions in the if then statement?

 

e.g.

 

Filter(VarCollection,tss_2.text=unique_id)

@v-siky-msft 

 

The data source is dynamic and each could be as many as 200k records.  Surely there has to be an alternative to hardcoding logic for each 2k rows.

I found my solution.  In the event you're struggling the following worked for me:

 

Button Press

 

Set(dataSource,Filter(dataSourceRead,unique_id=id))

Form Item property:

 

first(datasource)

Form Datasource

 

datasource

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,319)