I have a SharePoint list with a column "Next Review" which is a date column, and I need to get items that have a next review date that is previous to or equal to todays date.
Can anyone help with the filter query I would need please?
I currently have a SharePoint Get Items step - and am attempting to use the Filter Query parameter.
Your odata query should look something like this:
<Field> LE <Expression:utcNow()> as illustrated in my screenshot below. I have used Created in my example, at the point of running it will return everything that was created before the current datetime.
Replace the <Field> with the internal name of your field which can be found by going to list settings and then looking at the edit column url. If your field name has spaces in it when its created, you will find your field name will look something like Review_x0020_Date.
LE is the operator, i.e. less than or equal to.
The in single quotes ' ' create an expression with the forumula utcNow(). You'll see this appear in the intellisense, and this will take the exact date time stamp of when the Flow action is executed.
I hope that helps, please shout if there's anything else.
The filter query would be:
Next_x0020_Review le 'utcnow()'
where the utcnow between the apostrophes has to be done as an expression from the expressions tab over on the right.
(Edit: sorry, I posted without having refreshed the screen so hadn't seen the previous reply from Matt)
I've never actually used flows before, and have just realised my next issue - how I loop through these items as I can't find a foreach action (for each entry in this list that matches the query we just completed, I want to be able to email that user with details of that item)
How are you storing the details of the user? In a column in the SharePoint list?
But you need to add an "Apply to each" action, not a foreach, and select "value" from the dynamic content on the right.
hello @RobElliott , What will be the query for utcnow is greater than or equal to StartDate And less than or equal to EndDate? TIA
Just tested my flow and getting;
Thanks @MattWeston365 that worked - if I wanted to include a check for another field
Would it be;
and Status = "Open"?
Hi @markthompson3 glad you're getting there 🙂
You're almost right with what you put, with odata queries operators are always textual:
Full list here in section 5.1.2: https://www.odata.org/documentation/odata-version-3-0/url-conventions/
So your next part would be: and Status eq 'Open'
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
Many congratulations to the Season 1 2021 Flownaut Crew!
ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.