IoT Central API Query filter to enum property

Kevin BEAUGRAND (MVP) 26 Reputation points MVP
2022-03-23T10:49:02.75+00:00

Hi,

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:
185910-image.png

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 https://aka.ms/iotcentral-support. 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.
364 questions
{count} vote

1 answer

Sort by: Most helpful
  1. QuantumCache 20,271 Reputation points
    2022-09-02T04:02:17.4+00:00

    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.

    FYI

    237106-image.png

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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.