cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SylvieLet17
Responsive Resident
Responsive Resident

ODATA Query Filter versus Condition + Apply to each

Hi all, 

 

I have a general question about Flow performance. 

I'm new to ODATA, but I've been working with Flow for a while. 

 

I have a library with 600+ documents and steadily increasing. 

If I need to build a recurring flow to check on documents that are "expired" based on a date or text column, would it be better in terms of performance to build a "Get file properties" in an apply to each with a condition, or to build an ODATA guery filter in terms of performance?

I did try a condition-based flow and noticed it was extremely slow, but I haven't successfully managed to try an ODATA query yet (having issues with dates). Just wondering if it is worth it, or if it will be the same performance?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @SylvieLet17,

 

When there are mounting items in your list, it would be better to use Odata filter query to return the needed items. Otherwise, you will have to filter with each item with a Condition and which will be very slow.

 

What’s the issue you are having with date column?

 

When using Odata filter query with Date column, I would suggest you use a custom date column with date only format, but not the default date column such as Created/Modified.

 

Say I have a date column called Date, I want to filter out items that Date equals to today. I will use the following code:

Date eq ‘formatDateTime(utcnow(),’yyyy-MM-dd’)’

1.PNG

 

Please check this doc for more details:

https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)

 

 

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
ThreeTen
Advocate II
Advocate II

performance wise ODATA will beat out anything you do in flow (assuming the database is on is a sufficiently powerful server or you are querying a microsoft service like sharepoint, or Dynamics/CDS)


In flow you can utilize the Filter data operation action (rather than a conditional for-each) which still wont beat out an ODATA query..but usually takes a second max

v-yamao-msft
Community Support
Community Support

Hi @SylvieLet17,

 

When there are mounting items in your list, it would be better to use Odata filter query to return the needed items. Otherwise, you will have to filter with each item with a Condition and which will be very slow.

 

What’s the issue you are having with date column?

 

When using Odata filter query with Date column, I would suggest you use a custom date column with date only format, but not the default date column such as Created/Modified.

 

Say I have a date column called Date, I want to filter out items that Date equals to today. I will use the following code:

Date eq ‘formatDateTime(utcnow(),’yyyy-MM-dd’)’

1.PNG

 

Please check this doc for more details:

https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)

 

 

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

GabrielStJohn
Microsoft
Microsoft

Hello, @SylvieLet17!

 

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-yamao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager



Hi Mabel, 

No matter what I do I always get "The Expression \"Date eq 2018-10-10\" is not valid. 

 

I've tried using all kinds of different columns. I've used text custom date columns, and I've used the out of the box "Created" and "Modified" dates. 

 

See my error below:Odata_query1.pngodata query2.png

You need to wrap single quotes around your date string: Date eq ‘2018-10-09’

-Mark

Wow.

Sometimes I surprise even myself with my own stupidity. 

Thanks Mark, that worked. (Obviously)

We have all been there!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

Users online (30,094)