cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

"Filter Query" SharePoint Get Items by created date

Hi,

I have not had much luck locating the answer to this.

I would like to use the sharepoint get items action within flow however i would like to filter the query to include only items created in the last 3 days in order to reduce the amount of time it takes to run each of the subsequent actions for each item retrieved.

I presume I need to enter the query into the filter query section but I cannot seem to get it right. Any help would be much appreciated.

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: "Filter Query" SharePoint Get Items by created date

Hi @Jimbo1,

 

To use Filter query to get items created in the last three days, you could try to use the following code in your flow.

Created ge addDays(utcNow('yyyy-MM-dd'),-3,'yyyy-MM-dd')

The adddays function will subtract 3 days within utcnow.

 

Note: Please add a single quote around the adddays function. Please check the following screenshot.

1.PNG

 

Check the following docs for more details about the function:

Using Filter Expressions in OData URIs

Workflow Definition Language functions reference for Azure Logic Apps

 

 

 

Best regards,

Mabel Mao

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

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: "Filter Query" SharePoint Get Items by created date

Hi @Jimbo1,

 

To use Filter query to get items created in the last three days, you could try to use the following code in your flow.

Created ge addDays(utcNow('yyyy-MM-dd'),-3,'yyyy-MM-dd')

The adddays function will subtract 3 days within utcnow.

 

Note: Please add a single quote around the adddays function. Please check the following screenshot.

1.PNG

 

Check the following docs for more details about the function:

Using Filter Expressions in OData URIs

Workflow Definition Language functions reference for Azure Logic Apps

 

 

 

Best regards,

Mabel Mao

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

View solution in original post

Highlighted
Advocate I
Advocate I

Re: "Filter Query" SharePoint Get Items by created date

Thanks Mabel works great.

 

I was trying to use dateadd but couldnt get it to work.

Highlighted
Anonymous
Not applicable

Re: "Filter Query" SharePoint Get Items by created date

I have a requirement to use the Start Time of a calendar (SharePoint List). How do you check if the Start Time of a calendar event is equal to today's date. I tried using the internal name for Start Time (EventDate) along with Start Time and I continue to get query is invalid. 

 

GetItemFilter-EventDate.png

 

 

 

 

 

 

 

 

Highlighted

Re: "Filter Query" SharePoint Get Items by created date

I got the same issue here. I want to utilize both start time and end time which are called "EventDate" and "EndDate" respectively, but still getting the 400 error code.

Highlighted
Post Patron
Post Patron

Re: "Filter Query" SharePoint Get Items by created date

@v-yamao-msft Hi Mabel Mao,

The issue: Sharepoint "Created" date is different from my timezone,

So when i run the flow -> some items were excluded

Highlighted
New Member

Re: "Filter Query" SharePoint Get Items by created date

I cannot get this to work. I received the error mesasage:

{
"status": 400,
"message": "The query is not valid.\r\nclientRequestId: bc799bb6-fd2d-4bbb-933c-aaf4aeb7b816\r\nserviceRequestId: 434cd79e-6077-8000-4577-1a32b2059a94"
}

I tried your suggestion to the letter.

Anyu advice please?

Highlighted
Resident Rockstar
Resident Rockstar

Re: "Filter Query" SharePoint Get Items by created date

Hi @johnhadler .

You may get a quicker and more accurate response by starting a new thread at Get Help with Microsoft Flow and referencing this thread then providing full detail of your Flow and any issues.

 

If you have found my post helpful, please mark thumbs up.

 

Any other questions, just ask.

 

Thanks, Alan

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (7,333)