Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
hi,
Did anyone have the same problem also. It seems like the Javascript in ThingWorx cannot read the "-" as Element's name.
e.g. of Json:
{
"dataName-something": "1" ;
}
Thanks. Hope to find a solution here.
How are you trying to read it?
You should be able to use something like jsonObject["dataName-something"] or jsonObject.["dataName-something"]
I tried below code and it works fine for me.
var myObject = {"Sample-Check" : "10"};
var result = myObject["Sample-Check"];
With B/R,
Praveen
Hi all,
Thanks for your help.
It is working by inserting the ["dataName-something"] to the code.
e.g.
var response=Resources["ContentLoaderFunctions"].GetJSON(params)["dataName-something"] ;