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

"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
Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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

Jimbo1
Level: Powered On

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.

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

 

 

 

 

 

 

 

 

KarlChristopher
Level: Powered On

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.

luuminhvuong93
Level: Powered On

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

johnhadler
Level: Power Up

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?

Super User
Super User

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
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 (Last 30 Days)
Users online (5,739)