Support Forums
Passing parameters in the URL when using the VTScada JSON Driver

This question was left on our YouTube tutorial for the VTSCada JSON driver found here...
https://www.youtube.com/watch?v=gegzTIR88EE

Question: "Can you pass functions or vtscada parameters in the URL? I.e I want to use the latitude and longitude which are specified in the parent of the JSON/XML tag?"

Answer: Absolutely. You can put parameter expressions in the URL which reference VTScada values. We do this in our weather example.

Here is an example. (NOTE, you are fully responsible for testing any code or expressions found on this forum before deploying to an active system.)

api.openweathermap.org/data/2.5/weather?q=" + PickValid([newCityAreaNoSpace],"new%20york") + "," + PickValid([newCountryCode],"us") + "&units=" + PickValid([selectedUnits], "imperial")+ "&,id=524901&APPID=??????????????????????????

You can add this in the JSON/XML driver properties in the URL field found on the Settings Tab.

This question was left on our YouTube tutorial for the VTSCada JSON driver found here... https://www.youtube.com/watch?v=gegzTIR88EE Question: _"Can you pass functions or vtscada parameters in the URL? I.e I want to use the latitude and longitude which are specified in the parent of the JSON/XML tag?"_ Answer: Absolutely. You can put parameter expressions in the URL which reference VTScada values. We do this in our weather example. Here is an example. (NOTE, you are fully responsible for testing any code or expressions found on this forum before deploying to an active system.) ```` api.openweathermap.org/data/2.5/weather?q=" + PickValid([newCityAreaNoSpace],"new%20york") + "," + PickValid([newCountryCode],"us") + "&units=" + PickValid([selectedUnits], "imperial")+ "&,id=524901&APPID=?????????????????????????? ```` You can add this in the JSON/XML driver properties in the URL field found on the Settings Tab.

Note, for the sample code to work, you will need to sign up for a free open weather map account to get your own API key. Once you have an account, you can set up free, or paid, API keys here: https://home.openweathermap.org/api_keys

In the sample code, replace the question marks with your key where you see APPID=?????????

Note, for the sample code to work, you will need to sign up for a free open weather map account to get your own API key. Once you have an account, you can set up free, or paid, API keys here: https://home.openweathermap.org/api_keys In the sample code, replace the question marks with your key where you see APPID=?????????

Trihedral Engineering Ltd.

edited Nov 20 '20 at 12:55 pm
44
1
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft