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

Notifications

Announcements

No record found.

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)
  • DAnny3211 Profile Picture
    11,397 on at
  • Suggested answer
    YUN ZHU Profile Picture
    95,681 Super User 2025 Season 2 on at

    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

  • B Menick Profile Picture
    7 on at

    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

  • B Menick Profile Picture
    7 on at

    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

    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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,606

#2
YUN ZHU Profile Picture

YUN ZHU 931 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans