Preformatted textHey All,
I’ve been following a few threads to try and re-create the desired outcome but I haven’t quite yet got it my issue worked out.
I’m making a call to Emoncms that returns a JSON array with the code and data below.
Here is my code:
var String wattsUsedString = sendHttpGetRequest(url) logInfo("DEBUG", "DEBUG 1: " + wattsUsedString) var Number newValue = transform("JSONPATH", ".$", wattsUsedString) logInfo("DEBUG", "DEBUG 2: " + newValue)
The JSON returned value from the GET request is (DEBUG 1 printout):
Then the value printed out in DEBUG 2 is the same as the GET returned value (DEBUG 1).
I’m just having a heck of a time trying to understand why the JSONPATH isn’t working and pulling the last data value  of the array. The online JSONPath tool say that my “.$” should be return the second value, so I’m guessing that the var type that I’m assigning it is wrong, but I’ve tried numerous types and none are working for me.
Any help or documentation would be much appreciated.