0

I have a GetItems action with this settings, where i am filtering the items using a SharePoint field named ExpiryDate of type DateOnly (without time):-

enter image description here

First thing I defined this Filterquery:

johnjohn123_1-1681124436586.png

Which will result in this Filter Query:

((ExpiryDate eq '2023-04-22') or (ExpiryDate eq '2023-05-08') or (ExpiryDate eq '2023-06-07'))

But I only get 1 item out of 6321 items. So based on my reading I appended the ExpiryDate with this T00:00:00.000Zas follow:

enter image description here

Which result in this Filter Query:

((ExpiryDate eq '2023-04-22T00:00:00.000Z') or (ExpiryDate eq '2023-05-08T00:00:00.000Z') or (ExpiryDate eq '2023-06-07T00:00:00.000Z'))

But I got 5547 items out of 6321. I got the 6321 number, when I defined this SharePoint list view:

enter image description here

The total item count was 6321. Any advice what is going on? So why get items action is not able to get all the items?

Now in total I have 6321 divided as follow:

  1. 5805 with expiry date = 07 June 2023

  2. 258 with expiry date = 22 April 2023

  3. 258 with expiry date = 8 May 2023

So is there any advice what is going on?

0

1 Answer 1

1

Try generating and using SharePoint REST API endpoint in Get Items action like this:

https://****.sharepoint.com/sites/test/_api/web/lists/getbytitle('ListData')/items?$filter=(ExpiryDate ge datetime'2023-04-22T00:00:00Z' and ExpiryDate le datetime'2023-04-22T23:59:00Z') or (ExpiryDate ge datetime'2023-05-08T00:00:00Z' and ExpiryDate le datetime'2023-05-08T23:59:00Z') or (ExpiryDate ge datetime'2023-06-07T00:00:00Z' and ExpiryDate le datetime'2023-06-07T23:59:00Z')

Make sure your ExpiryDate date column is indexed in the SharePoint list.

Similar thread: Power Automate Filter query on created date column

Also, based on regional settings of your SharePoint site there might be chances that actual date values stored in SharePoint list does not match with the dates your passing in filter queries hence you are receiving less number of results.

2
  • thanks for the reply. but what if the first part of the query return more than 5000 items will i get any threshold errors? Apr 26, 2023 at 11:57
  • I think you should not be the error. Apr 26, 2023 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.