cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mheptinstall
Level: Powered On

Get all SharePoint list items using @odata.nextLink

How do you get all list items in a SharePoint list using the @odata.nextLink value returned in the response? I want to update a column value on every list item each day which calculates the difference between created date and the current date.

 

I have a list that contains 907 items, if I use the default settings of the Get List Items action it returns only 100 with the @odata.nextLink value for the next page.

 

I can turn on the Pagination option and set the threshold to the maximum value of 5000 which will work but won't work should my list ever reach more than 5000 items. I also notice that when the Pagination option is turned on the @odata.nextLink value is no longer in the returned response.

 

I can get the @odata.nextLink value using body('Get_items')?['@odata.nextLink'] but not really sure how I should be using it with the Get List items action.

4 REPLIES 4
Community Support Team
Community Support Team

Re: Get all SharePoint list items using @odata.nextLink

Hi @mheptinstall,

 

The default value of the get items is 100, and you could set the could be a number greater than 0 and less than or equal to 100000.

Annotation 2019-09-24 105147.pngWhat's your final goal is want to calculates the difference between the created date and the current date, so I advice you can use the calculated column to get the Datedif, please refer to this document:

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/bb862071(v%3Doff...

This is the link that how to create a Today column:

https://www.sharepointpals.com/post/how-to-get-the-current-date-in-sharepoint-calculated-column/

After that, create a calculated column to get the DateDif between the create date and current date.

For example:

Annotation 2019-09-24 113230.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mheptinstall
Level: Powered On

Re: Get all SharePoint list items using @odata.nextLink

Whilst the UI indicates the range is 0 to 100000 if you try to set it to anything above 5000 it will throw an error when trying to save:

 

Q94e2r8iSI.pnggOBHbVnjmW.png

 

The column represents the days waiting, calculated columns only calculate when the list item is created/edited which is the reason why I cannot use a standard calculated column.

Community Support Team
Community Support Team

Re: Get all SharePoint list items using @odata.nextLink

Hi @mheptinstall,

 

Well, it may have some error with the UI, you could consider the second method I provided, it is more simple and quick.

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mheptinstall
Level: Powered On

Re: Get all SharePoint list items using @odata.nextLink

The second solution will not work as calculated columns only calculate when the item is created/updated, it states this at the bottom of the article:

 

Please note that this calculate column will show the Current Date only if the item is edited otherwise it will show the last updated date, the Calculated col value won’t be updated automatically.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 303 members 5,813 guests
Please welcome our newest community members: