cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kyza
Helper II
Helper II

SharePoint - Get Items - Filter Query

Hello,

I am currently creating a flow, which is supposed to be run upon certain items from the list.

I can help my self with the condition, that does that, but then the flow has to process every single item in the list.

I was wondering if I can help my self using Filter Query in the step of Get items.

 

I have a column containing a date (Due_date) and I need to select only those items, where Due_date is lesser than Today.

So I have tried this: Due_date lt 'utcNow()'

Obviously it does not work, that's why I am here and wondering if it is even possible or if the filter options are limited.

 

Thanks in advance.

Marek

1 ACCEPTED SOLUTION

Accepted Solutions
Kyza
Helper II
Helper II

I believe that I have found the solution

 

Due_date lt '@{body('Current_time')}' - please note that '@{body('Current_time')}' is generated by including the time object, I am having issues upload the picture for some reason, tried 5 times and gave up.

 

But, now if I would want to add 1 more condition like, do not include items where Status eq finished, do I just write and in between or something like that?

View solution in original post

8 REPLIES 8
Kyza
Helper II
Helper II

I believe that I have found the solution

 

Due_date lt '@{body('Current_time')}' - please note that '@{body('Current_time')}' is generated by including the time object, I am having issues upload the picture for some reason, tried 5 times and gave up.

 

But, now if I would want to add 1 more condition like, do not include items where Status eq finished, do I just write and in between or something like that?

View solution in original post

@Kyza yes you do, just add and then the second part of the filter query.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

ScottShearer
Super User III
Super User III

@Kyza 

You'll need to convert the date to the same format as SharePoint stores dates internally.

Your filter should look like this:

Due_Date lt 'formatDateTime(utcNow(),'yyyy-MM-dd')'

The single quotes are required.  You need to enter formatDateTime() as an expression.

formatDateTime.jpg

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @ScottShearer and thanks for your help, I have used the Dynamic Content of Current Time for the comparison 🙂

But thanks for your suggestions, have a great day!

@Kyza the comparison needs to use the US yyyy-MM-dd format, it won't work otherwise. So do try what Scott has said as it is the way to do it.

Rob
Los Gallardos

@RobElliott - I've tried the flow bunch of time using just the Dynamic Content and it works like a charm.

 

image.png

@Kyza but you said "So I have tried this: Due_date lt 'utcNow()Obviously it does not work". I've lost track of what you are asking.

Rob
Los Gallardos

@RobElliott - Sorry for making this thread a mess.

1) I've asked with the non-functional query you mentioned

2) Before anyone responded I figured out that I can use the Dynamic Content and wrote a reply that I later marked as a solution

3) I was still wondering how can I add another parameter to the filter which you have clarified

 

Shortly, everything is fine now and sorry for the chaos 🙂

Thanks for your contribution

Helpful resources

Announcements
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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (54,153)