Hello,
I would like some help in getting Survey123 to populate attribute fields with weather parameters. It looks like there used to be a document on how to do this, but it’s no longer available.
This site points to another link with some instructions:
It looks like MSN Weather also has parameters:
https://docs.microsoft.com/en-gb/connectors/msnweather/
Open Weather has this information:
https://openweathermap.org/api/one-call-api#how
However, I’m unfamiliar with Javascript, and don’t know how to apply this information to my specific problem. I need a step-by-step breakdown of how to use a pulldata function to get parameters either from Open Weather or MSN Weather, showing a specific javascript code example that I can use as a model from which to copy. The actual pulldata function is straightforward, but I need help mostly with the JS part.
Solved! Go to Solution.
I have found a solution for this:
There is a sample Survey123 template in Survey123 Connect that provides the code:
The sample survey has a Working with a Third-Party API - Open Weather example.
Once the sample survey is created, you will have access to the xls form as well as the JavaScript files used to create the survey. You can reference the pulldown expression and the Javascript code when creating your survey.
The sample code provides an API key, but you can sign up to OpenWeather and get your own key. There's a lot of documentation on making API calls:
https://openweathermap.org/api
The one downside I discovered, however, is that using a free OpenWeather account you can get CURRENT weather parameters, and hourly forecast data, but unfortunately you cannot get a daily forecast summary (e.g. min and max temperature) without paying for an OpenWeather subscription.
I have found a solution for this:
There is a sample Survey123 template in Survey123 Connect that provides the code:
The sample survey has a Working with a Third-Party API - Open Weather example.
Once the sample survey is created, you will have access to the xls form as well as the JavaScript files used to create the survey. You can reference the pulldown expression and the Javascript code when creating your survey.
The sample code provides an API key, but you can sign up to OpenWeather and get your own key. There's a lot of documentation on making API calls:
https://openweathermap.org/api
The one downside I discovered, however, is that using a free OpenWeather account you can get CURRENT weather parameters, and hourly forecast data, but unfortunately you cannot get a daily forecast summary (e.g. min and max temperature) without paying for an OpenWeather subscription.
Has anyone create a survey to pull historical weather data with the new One Call 30.0 API?