cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AX-Imran
New Member

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

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

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
sergeluca
MVP

the operator is 'substringof'

 

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

 

Kind regards

 

Serge Luca

 

v-yuazh-msft
Community Support
Community Support

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

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)

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
}

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

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,901)