pamela.denchfield

Show live weather data for the selected city

Blog Post created by pamela.denchfield Employee on Oct 26, 2015

Nintex Forms Enterprise Edition

 

This tutorial walks through steps to display current wind direction for the city selected on the form. The tutorial uses the Web Request form control from Nintex Forms Enterprise Edition to send a GET request to the Yahoo weather API (anonymous authentication), filtering based on the city selected on the form (ChoiceField).

 

Figure: Example of a form displaying wind direction for London; if another city is selected, the wind direction is updated for that city.

 

Prerequisites:

  • List column WindDirectionID for binding the XPath value field
  • List column WindDirectionText for binding the XPath display field
  • Choice control “ChoiceField” with valid values for cities referenced by the API (example follows)
    • Casablanca
    • London
    • Melbourne
    • Paris

 

Once you have the above prerequisites, add the Web Request form control to the form and apply the following configuration. Publish the form and you're done!

Note: Red text indicates inserted references.

 

Field

Value

Notes

Name

WindDirection

 

ID connected to

WindDirectionID

 

Text connected to

WindDirectionText

 

Display format

Label

 

Service URL

https://query.yahooapis.com/v1/public/yql?q=select wind from weather.forecast where woeid in (select woeid from geo.places(1) where text='ChoiceField')&format=json

To insert a reference to ChoiceField, select it from Named Controls in the Insert Reference dialog box.

Request method

GET

 

Authentication type

Anonymous

 

XPath for display

//direction

 

Outcomes