AWS IoT SQL: Parsing string to JSON

Viewed 31

I am writing an AWS IoT Core rule where the incoming message object has a property that contains JSON in an escaped string. Is there a way to convert this to JSON in the result?

Example

Input message

{
    "Value": "{\"x\": 1, \"y\": 2}",
    "Timestamp": "2022-09-09T13:44:37.000Z"
}

Desired output

{
    "x": 1,
    "y": 2,
    "Timestamp": "2022-09-09T13:44:37.000Z"
}

I am aware that it is possible to write a lambda to do this, but I was hoping that it would be possible to do with just SQL

0 Answers
Related