Select to view content in your preferred language

Survey123 Open Weather One Call API 3.0 - Historical Weather

1124
5
02-27-2023 01:30 PM
DanLissick
Occasional Contributor

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
5 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
Occasional Contributor

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
Regular Contributor

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
jeffhyderBRVA
Emerging Contributor

Did you ever get this to work correctly? i am trying to do something similar for an odor report near a landfill and I am trying to collect the weather information for the time and date inputted by the end user. Any and all help is greatly appreciated. The regular weather.js is working for current but that may not actually tell me the correct conditions when the odor was noticed. Thank you in advance.

 

0 Kudos
DanLissick
Occasional Contributor

I was not able to get this to work. I believe you would need to pay for the Open Weather api instead of using the free version. If you ever find a solution I would I would appreciate a response to this post.

0 Kudos