Select to view content in your preferred language

Survey123 Open Weather One Call API 3.0 - Historical Weather

672
3
02-27-2023 01:30 PM
DanLissick
New Contributor III

I am make a form that I would like to call historical weather information when the user picks a date. I was able to get a general JSON response but am having trouble calling individual fields like precipitation. I am using Open Weather One Call API 3.0. Attached is the test xls form and js file for reference.

Tags (1)
0 Kudos
3 Replies
ZacharySutherby
Esri Regular Contributor

Hello @DanLissick

To extract JSON from the response you will need to use pulldata("@json") in order to access specific properties. 

We have a JavaScript sample available in Connect that shows how to use the pulldata("@json") function. 

 

 

Thank you,
Zach
0 Kudos
DanLissick
New Contributor III

Hey @ZacharySutherby 

I do have that function in the attached documents. What I am looking for help on is a specific formatting pulldata("@json"). Here is an example: pulldata("@json", ${weather_json}, "weather[0].main"). Using the Open Weather One Call API 3.0 - Historical Weather do you know how "weather[0].main" should be formatted? I can get Row 13 to run but now row 14 in the attached .xlsx. I have also attach the.js file.

0 Kudos
MFazio
by
New Contributor III

I know it's been a while since OP, but I've gotten this to work for the non-historical dataset (e.g. v2.5):

MFazio_1-1690577235767.png

 

I'm now attempting to use the historical One Call to get weather for past surveys and am not able to get the fields to populate after selecting a date. Thinking it has something to do with the fact that maybe the API call fires off as soon as the survey opens and thus the date field is blank? 

0 Kudos