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

LastN problem

 

 

Hi guys,

 

I have a document library with more then 5000 records,

I used a Data Table, to filter the data I used LastN to get the latest documents. I have documents from yesterday, but it doesnot shows them.

Any suggestion?

Thank you,

LastN problem.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Resident Rockstar
Resident Rockstar

Re: LastN problem

@farsami,

There is a parameter in your application where you can set the limit of the maximum number of records to handle within one request when going through the SharePoint connector:

Image 1.png

The default value is 500. You can increase it up to 2000 max.

So even if you set it to 2000 and use the LastN function to retreive (let's say) the last 100 items, it will retreive items 1900 to 2000. And if you put your whole datasource as the main datasource for a DataTable control, you will see only the first 2000 records and it's only if you scroll down to the 2000th items that the connector will retreive the next items by blocks of 100 items each.

If you want to retreive the latest 100 items from your 5000 list items, you have 2 solutions:

  1. The easiest one is to sort your datasource on the modified date in descending order and pick the first 100 items
  2. The hardest way is to collect all 5000 items in a collection through a loop that will retreive the items by blocks of 500 items

So I really suggest you the first option, which should look like this:

FirstN(Sort(<yourdatasource>,Modified,Descending),100)

I hope this helps your case...

Emmanuel

View solution in original post

Highlighted
Resident Rockstar
Resident Rockstar

Re: LastN problem

Hi @farsami,

Glad it worked ! Please select my answer as an Accepted Solution so others can find the solution easily...

Emmanuel

View solution in original post

4 REPLIES 4
Highlighted
Helper II
Helper II

Re: LastN problem

There was a problem with editting my message.

Here's my filter;

ClearCollect(TimeSheetsofProject, AddColumns(LastN (Timesheets, 100000), ....))

Highlighted
Resident Rockstar
Resident Rockstar

Re: LastN problem

@farsami,

There is a parameter in your application where you can set the limit of the maximum number of records to handle within one request when going through the SharePoint connector:

Image 1.png

The default value is 500. You can increase it up to 2000 max.

So even if you set it to 2000 and use the LastN function to retreive (let's say) the last 100 items, it will retreive items 1900 to 2000. And if you put your whole datasource as the main datasource for a DataTable control, you will see only the first 2000 records and it's only if you scroll down to the 2000th items that the connector will retreive the next items by blocks of 100 items each.

If you want to retreive the latest 100 items from your 5000 list items, you have 2 solutions:

  1. The easiest one is to sort your datasource on the modified date in descending order and pick the first 100 items
  2. The hardest way is to collect all 5000 items in a collection through a loop that will retreive the items by blocks of 500 items

So I really suggest you the first option, which should look like this:

FirstN(Sort(<yourdatasource>,Modified,Descending),100)

I hope this helps your case...

Emmanuel

View solution in original post

Highlighted
Helper II
Helper II

Re: LastN problem

Thx,

It worked

 

Highlighted
Resident Rockstar
Resident Rockstar

Re: LastN problem

Hi @farsami,

Glad it worked ! Please select my answer as an Accepted Solution so others can find the solution easily...

Emmanuel

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (8,743)