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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to filter Odata with multiple enum value D365

(0) ShareShare
ReportReport
Posted on by 30

Hi All,

How could i filter odata with multiple enum value? I tried using this filter on the postman and not success

$filter=Type eq Microsoft.Dynamics.DataEntities.RateType'OC' And Type eq Microsoft.Dynamics.DataEntities.RateType'C'

Thanks 

Masha

I have the same question (0)
  • Verified answer
    Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Masha,

    You need to use 'OR' instead of 'AND' as enum field can't contain more than one value and 'AND' condition will always return false.

  • it.dev Profile Picture
    30 on at

    Hi Sergei,

    I tried it with or and still not success

    Thanks,

    Masha

  • Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Masha,

    Do you get any data if you just filter by one of the enum value (without 'and' or 'or' condition)?

  • it.dev Profile Picture
    30 on at

    Hi Sergei,

    Yes i can get the data if filter only one of the enum

    Thanks

    Masha

  • Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Masha,

    Could you, please, provide the full url you are using?

    At least for me 'or' condition is working fine, maybe you have other parameters in the url?

    <MyUrl>/data/SalesOrderHeadersV2?$filter=SalesOrderStatus eq Microsoft.Dynamics.DataEntities.SalesStatus'Backorder' or SalesOrderStatus eq Microsoft.Dynamics.DataEntities.SalesStatus'Canceled'

  • it.dev Profile Picture
    30 on at

    Hi Sergei,

    this is my url

    <MyUrl>/data/RateTypeEntity?$filter=Type eq Microsoft.Dynamics.DataEntities.RateType'OC' And Type eq Microsoft.Dynamics.DataEntities.RateType'C'

  • Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Masha,

    But it's still using 'And' keyword.

    Try to use that example <MyUrl>/data/RateTypeEntity?cross-company=true&$filter=Type eq Microsoft.Dynamics.DataEntities.RateType'OC' or Type eq Microsoft.Dynamics.DataEntities.RateType'C'

  • Suggested answer
    Deekshit Addepalli Profile Picture
    Microsoft Employee on at

    If you want to return values corresponding to both enums, then you would use the binary "OR" which roughly translates to "AND" in english :)

    If you use AND in your expression (URL) then its looking to see if there is a match that satisfies RateType=OC and RateType=C for the same record.

  • it.dev Profile Picture
    30 on at

    Hi Sergei and Deekshit,

    Still not success either use AND / OR. Here's the error i got in the postman

    "Syntax error at position 90 in 'Type eq Microsoft.Dynamics.DataEntities.RateType'OC' OR Type eq Microsoft.Dynamics.DataEntities.RateType'C''."

    Thanks,

    Masha

  • udaY-ch Profile Picture
    5,175 on at

    Hi,

    Try using enumValueName than enum value label.

    Uday

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 797

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 610 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 534

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans