cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

the operator is 'substringof'

 

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

 

Kind regards

 

Serge Luca

 

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (7,105)