OData query filter by enum

0
Hi community, I have published an entity as an Odata Service. Now I am testing the endpoints. I have problems filtering by enums. I am not sure about the spelling of the query.   Currently I use, as I understood it in the documentation    /requests?$filter=Status eq Core.ENUM_Status'Required'   The attribute is called 'Status'The value I want to filter by is 'Required'The enum is called ENUM_StatusThe enum is in the module core   Thanks for helping.
asked
1 answers
0

It depends on how you expose the attribute in your OData.

You can setup if you want to use the String or Enumeration data type. When you use string, you can then filter just using the key value as string:

  • /requests?$filter=Status eq 'Required'

If you configure it to be an enumeration, it's indeed like you describe:

  • /requests?$filter=Status eq Core.ENUM_Status'Required'

where namespace (Core) is defined in your OData general settings and the exposed name and values of the Enumeration can be altered on the tab 'Enumerations'

image.png

answered