IoT Central API Query filter to enum property

Kevin BEAUGRAND (MVP) 26 Reputation points MVP


I'm looking for an example for querying devices on IoT Central that have a Cloud property in Enum type.

I defined the cloud property as this:

I wanted now to query devices that have a specific environment property value:

"query": "SELECT $id, vehicle_id as vehicle, environment FROM dtmi:modelDefinition:xvabl5ogp:e7dnkfmwpsw where vehicle=null and environment='development'"    

But this failed with error:

"error": {
"code": "InvalidBody",
"message": "Value in WHERE clause for attribute environment is not of expected type Schemas/String. You can contact support at Please include the following information. Request ID: 19c88nco, Time: Wed, 23 Mar 2022 10:42:20 GMT.",
"requestId": "19c88nco",
"time": "Wed, 23 Mar 2022 10:42:20 GMT"

Do someone have an example to querying devices and filtering them by an enum property ?

Thank you for your help.

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
354 questions
{count} vote

1 answer

Sort by: Most helpful
  1. QuantumCache 20,031 Reputation points

    Hello @Kevin BEAUGRAND (MVP) , thanks for awaiting the product teams response on this. This is now released as a feature.

    Thanks for contributing for the improvement of Azure IoT Central Product, please keep using this forum.



    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments