JsonEmport not working for me
-
I used this code before our last update to 3.6... now this returns an eof error.
print(JsonEmport.dataPointQuery("eq(name,FAN COIL VALVE)&limit(1000)"));``` Expected } but found eof //JsonEmport.doImport(JSON.stringify({"dataPoints": dataPoints})); ^ at line: 8, column: 90 at line: 8, column: 9
-
@Phillip-Weeks
That bug is fixed in 3.7.x I was not aware it was in the 3.6 release. I am planning another 3.6 release in the next few weeks so I'll get that fix in there. In the meantime you cannot end a script with a comment line. So adding a newline after that I think should work. -
Thanks no that was not in the script I added that after. This produces the same result. It is 3.6 and I will upgrade to 3.7 shortly if it fixes this. Thanks for your reply,
var dataPoints = JSON.parse(JsonEmport.dataPointQuery("eq(name,FAN COIL VALVE)&limit(1000)")).dataPoints; print(JsonEmport.dataPointQuery("eq(name,FAN COIL VALVE)&limit(1000)"));
-
@Phillip-Weeks I just implemented a Scripting Data source that runs this script and see no errors on Mango 3.6.6?
var dataPoints = JSON.parse(JsonEmport.dataPointQuery("eq(name,Voltage)&limit(1000)")).dataPoints; print(JsonEmport.dataPointQuery("eq(name,Voltage)&limit(1000)"));
I am searching for a point named
Voltage
Output:
"dataPoints":[ { "xid":"voltage", "name":"Voltage", "enabled":true, "loggingType":"ON_CHANGE", "intervalLoggingPeriodType":"MINUTES", "intervalLoggingType":"INSTANT", "purgeType":"YEARS", "pointLocator":{ "dataType":"NUMERIC", "changeType":{ "type":"BROWNIAN", "max":100.0, "maxChange":0.01, "min":0.0, "startValue":"1" }, "settable":true }, "eventDetectors":null, "plotType":"STEP", "rollup":"NONE", "unit":"V", "simplifyType":"NONE", "chartColour":"", "chartRenderer":null, "dataSourceXid":"DS_997094", "defaultCacheSize":1, "deviceName":"Dashboard Demo", "discardExtremeValues":false, "discardHighLimit":0.0, "discardLowLimit":0.0, "intervalLoggingPeriod":15, "intervalLoggingSampleWindowSize":0, "overrideIntervalLoggingSamples":false, "preventSetExtremeValues":false, "purgeOverride":false, "purgePeriod":1, "readPermission":"user", "setExtremeHighLimit":1.7976931348623157E308, "setExtremeLowLimit":-1.7976931348623157E308, "setPermission":"", "tags":null, "textRenderer":{ "type":"ANALOG", "useUnitAsSuffix":true, "format":"#.00" }, "tolerance":0.0 } ] }
The cause must be specific to your system. Perhaps that specific point is corrupt? Try another point and if that doesn't work take a look at the logs and see if anything is being output about the error.
Thanks.