I have a tag that is coming in as a json format but I’m wondering if there is a way to convert this json tag to inidividual memory tags?
here is the property is of the tag
{
“accessRights”: “Read_Only”,
“dataType”: “String”,
“enabled”: true,
“name”: “iotgateway1”,
“tagType”: “AtomicTag”
}
# Read the tag and get its value
string = system.tag.readBlocking(['[MQTT Engine]iotgateway2'])[0].value
# Decode the string
dictOut=system.util.jsonDecode(string)
for val in dictOut['values']:
print val['id'], val['v'], val['q']
One last question, lets say I start to add more tags to the json file. How can I adjust the jsonGet to look for specific tags and its values only since the json file is going to have several tags and I wanted to associate those tags to individual expression tags?
example of json.
{
“timestamp”: 1647449695415,
“values”: [