cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jimbo1
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
v-yamao-msft
Community Support
Community Support

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
v-yamao-msft
Community Support
Community Support

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

Thanks Mabel works great.

 

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

Anonymous
Not applicable

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

 

 

 

 

 

 

 

 

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.

@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

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?

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
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (53,109)