cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
WillPage Skilled Sharer
Skilled Sharer

OData filter combining multiple or statements with and

Hello,

I need to filter a SharePoint Get files (properties only) action to return items that match either one of several content types with a Created gt 'addDays(utcNow(),-7)' filter to get a list of documents that have been created in the past week and match one of a few content types.

My filter goes something like...

Created gt 'addDays(utcNow(),-7)' and ContentType eq 'Invoice' or ContentType eq 'Remittance'

What I get is every remittance on the whole document library created any time and every invoice created in the past 7 days.

How can I bracket these statements? I can move the Created gt filter out to a condition but then when I perform an action on the result (build an html table) I get an automatic for each. The whole filter needs to be in the initial get files action so I can build a single html table that matches my filter.

Is this possible? If not, is there a workaround?
1 ACCEPTED SOLUTION

Accepted Solutions
WillPage Skilled Sharer
Skilled Sharer

Re: OData filter combining multiple or statements with and

Hi Mabel,

 

I got around this by bracketing the statements:

 

Created gt 'addDays(utcNow(), -7)' and (ContentType eq 'Invoice' or ContentType eq 'Remittance')

 

I don't know why I didn't try that before posting here, but thanks anyway; I have another use for the Filter array action so I still learned something from you!

View solution in original post

3 REPLIES 3
Community Support
Community Support

Re: OData filter combining multiple or statements with and

Hi @WillPage,

 

Instead of using a Condition, please try to use the action Filter array. Then in the action Create HTML table, it would be able to select value from the filtered items.

Please check the following image for a reference:

 1.PNG

 

Best regards,

Mabel

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.
WillPage Skilled Sharer
Skilled Sharer

Re: OData filter combining multiple or statements with and

Hi Mabel,

 

I got around this by bracketing the statements:

 

Created gt 'addDays(utcNow(), -7)' and (ContentType eq 'Invoice' or ContentType eq 'Remittance')

 

I don't know why I didn't try that before posting here, but thanks anyway; I have another use for the Filter array action so I still learned something from you!

View solution in original post

Community Support
Community Support

Re: OData filter combining multiple or statements with and

Hi @WillPage,

 

Thanks for sharing and updating.

I am very glad that you have figured it out and it is working for you now.

 

Best regards,

Mabel

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.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,349)