cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AX-Imran
Level: Power Up

Search using Odata in flow

I want to know what is the operator for contains in odata query..
 
Invalid options specified in OData query. or operator expected at position 88 in 'State eq 'Active' and (OwningServiceId eq xxxxxx or OwningServiceId eq xxxxx) and (Title contains 'Mitigated by Self-Heal Action')'.
 
My flow is failing with invalid options. Looks like it does not like the word contains.. I am trying to search by the words.. eq works fine but I a need contains as I am looking for keywords in my search.
 
Any one know what is the operator for contains.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Search using Odata in flow

I've just retested it ad it works as a charm, here is my code substringof.png

 

Would you mind sharing your code ?

 

Cheers

 

Serge Luca aka 'Doctor Flow'

View solution in original post

Hugsville1e6
Level: Power Up

Re: Search using Odata in flow

Hi,

 

After a bit of scrabbling, found out whats going on.

 

To construct substringof the variable must be entered from the dynamic pane, rather than typed as an expression and the variable selected be surrounded by quote characters thus:

 

test1.gif

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Search using Odata in flow

the operator is 'substringof'

 

so the expression should be ........ substringof('Mitigated by Self-Heal Action',Title)

 

Kind regards

 

Serge Luca

 

Community Support Team
Community Support Team

Re: Search using Odata in flow

Hi @AX-Imran,

 

Have your issue be solved? 

 

As @sergeluca said, you could take a try to fill in the "Filter Array" column use expression below to achieve your needs:

substringof('Mitigated by Self-Heal Action',Title)

 

I have made a test on my side and have created a flow as below:

Capture.PNG

 

 

 

The flow would run successfully to filter out the items which's title contains "Mitigated by Self-Heal Action" as screenshot below:

Capture.PNG

 

Regards,
Alice Zhang

anhthuch4ng
Level 8

Re: Search using Odata in flow

Great suggestion @sergeluca!

 

Hi @AX-Imran,

Have you had a chance to apply @sergeluca and @v-yuazh-msft's suggestions to your Flow above?

If yes and you found that solution to be satisfactory, please go ahead and mark the relevant replies as the "Accepted Solution". 🙂


Happy Flowing,
-AT (Flow Community Admin)

Hugsville1e6
Level: Power Up

Re: Search using Odata in flow

Hi,

 

That doesn't work - I get this when attempting to use substringof:

 

{
status: 400,
message: The function operator 'substringof' is not supported or its usage is invalid
}
Super User
Super User

Re: Search using Odata in flow

I've just retested it ad it works as a charm, here is my code substringof.png

 

Would you mind sharing your code ?

 

Cheers

 

Serge Luca aka 'Doctor Flow'

View solution in original post

Highlighted
Hugsville1e6
Level: Power Up

Re: Search using Odata in flow

Hi,

 

If the data you want to find is in a variable that will not work when applied to substringof - only an explicit search string entered will work. Try this.

 

Assign Toky to a variable called say strSearchString

Use that variable instead of Toky thus:

 

substringof(variables('strSearchString'),Title)

 

Whilst it will save the attempt to run that will fail with badrequest

 

Cheers

 

G

Hugsville1e6
Level: Power Up

Re: Search using Odata in flow

Hi,

 

After a bit of scrabbling, found out whats going on.

 

To construct substringof the variable must be entered from the dynamic pane, rather than typed as an expression and the variable selected be surrounded by quote characters thus:

 

test1.gif

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,310)