Trying to decode a JSON Payload with special characters (-) in IOT Central in Device template

Cheah, Felix FC 0 Reputation points
2023-07-03T22:16:53.02+00:00

I've managed to get the decoded payload as an object and managed to get to "Accelerometer" object and seen values in "LogIndex" and "time". However i can't get to the object "X-Axis" in "Accelerometer". This is because when i try type "X-Axis" as the object name in IOT central it says special characters are not allowed. Is there a way around this? https://imgur.com/a/EKFTnGy https://imgur.com/a/wtaYCKi

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

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 13,471 Reputation points
    2023-07-04T00:02:33.7866667+00:00

    Hi @Cheah, Felix FC Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.

    The device templates of Azure IoT Central uses Digital Twin Definition Language (DTDL) V2 to define its models. The fields defined in this template limitations based on the DTDL. To get more information on this, please refer the Device Models section of IoT Central Device Templates documentation.

    The name property has the following limitation defined on the DTDL language - "max 64 characters; contains only alphanumerics and underscore, starting with a letter, ending with alphanumeric; must be unique for all contents in Interface". Please look under the Field section of the object for more details on this.

    As far as I can tell, this is a hard limitation determined by the DTDL and cannot be worked around. The portal does not let you create a field with name that contains "-". Please let us know if you follow a different approach of importing the device model which allowed you to define names with "-". This is a bug that needs to be investigated.

    You can suggest an idea to the product to include special characters in the name through the following link - Azure IoT Central Product Feedback All though not a work around, in the meantime, you can perhaps use "_" in the name instead of "-" in the name.

    Hope this helps. Please let us know if you have any additional questions or need further clarification.


    If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.