web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

ODATA URI not contains doesn't work

(0) ShareShare
ReportReport
Posted on by 7

Hi,

I want every record that doesn't contain a specific word.

I've tried the following:

"not(contains({Field}, '{Value}'))" resulting in "Client requests that contain ''Not'' filter options are not supported by Dynamics 365 Business Central OData web services."

"not contains({Field}, '{Value}')" resulting in "Client requests that contain ''Not'' filter options are not supported by Dynamics 365 Business Central OData web services."

"indexof({Field}, '{Value}') eq -1" resulting in "Client requests that contain ''indexof'' filter options are not supported by Dynamics 365 Business Central OData web services."

Can anyone explain why this is happening and why these things are not supported while the documentation here says that it does and how I can fix this?\

learn.microsoft.com/.../use-filter-expressions-in-odata-uris

I have the same question (0)
  • B Menick Profile Picture
    7 on at
    RE: ODATA URI not contains doesn't work

    Hi

    I found a solution to this.

    I found out that contains works in a bit of a weird way. We need to compare it to a boolean.

    For example:

    contains({Field}, '{Value}') eq true

    But to check if it DOESN'T contain a certain value we have to use ne true instead of eq false. Because eq false doesn't return any records but says that the odata uri query is valid. So for some reason using ne true does return the correct records.

    For example:

    WORKS: contains({Field}, '{Value}') ne true

    DON'T WORK: contains({Field}, '{Value}') eq false

  • B Menick Profile Picture
    7 on at
    RE: ODATA URI not contains doesn't work

    Hi Daniele

    The problem with the first link is that my list would be way too big. There are too many combinations to consider which is why I need a contains functionality or something similar to that.

    The second link is a link that I'm already aware of. But for some reason some of those filter expressions are not supported. Any idea why?

    Bo

  • B Menick Profile Picture
    7 on at
    RE: ODATA URI not contains doesn't work

    Hi Zhu

    I've tried a few things as described above. Which one of the things was the indexof and unfortunately it says that it isn't supported.

    Bo

  • Suggested answer
    YUN ZHU Profile Picture
    92,429 Super User 2025 Season 2 on at
    RE: ODATA URI not contains doesn't work

    Hi, unfortunately, as far as I know, "not" is not supported in BC's API and Odata's filter method.

    I'm not sure if "indexof" is supported. Anyway we can only avoid using these methods.

    Hope that other experts can give you better advice.

    Thanks.

    ZHU

  • DAnny3211 Profile Picture
    11,374 on at
    RE: ODATA URI not contains doesn't work

    hi

    look this

    stackoverflow.com/.../odata-uri-filter-expression-for-not-in

    learn.microsoft.com/.../use-filter-expressions-in-odata-uris

    DAniele

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,119

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,902

#3
Sumit Singh Profile Picture

Sumit Singh 3,021

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans