On 22nd July 2015 we released Nintex Forms Enterprise edition. Nintex Forms Enterprise includes the ability to bring external database connectivity and web services to forms. In this post I will demonstrate how to use the Web Request Control to create live weather data feed for a Sailboat booking form.
The Web Request control allows you to call REST APIs using either GET or POST requests by simply entering basic information such as Service URL, Request Method (GET or POST) and Authentication Type (supported types: Anonymous, Basic Authentication or Windows Authentication) . This control leverages the SharePoint Secure Store Service in order to protect the Credentials . Simply enter the target application id stored in Secure Store Service containing the credentials. For more information about Secure Store Service on SharePoint, see the Microsoft article Configure the Secure Store Service in SharePoint 2013. This Control also supports multiple display formats similar to Nintex Choice Control - Option buttons, Checkboxes (Multiple Selection), Dropdown list or Text/Label.
For this Sailboat booking form, we want to display current wind condition (wind direction and wind speed) using Yahoo weather API. Yahoo weather API provides up-to-date weather information for any location, including 5-day forecast. However for this form we are only after the wind condition information. More information on Yahoo weather API is available here. For this form, I have used below query in the Service URL field. This query will return live wind condition information for city of Melbourne.
https://query.yahooapis.com/v1/public/yql?q=select wind from weather.forecast where woeid in (select woeid from geo.places(1) where text='melbourne')&format=json
You can execute your web request during design time by using "Run Now" dialog. By clicking on "Test Request" button you can view the results in test results section. Please note that when you perform "Test Request" - any specific create, query, update or delete operations are committed. For our request the Test Result section shows below data:
<?xml version="1.0" encoding="utf-16"?>
Now you can select which value to be displayed using Xpath .In this case I have selected direction element value to be displayed.
I have also configured another web request control on this form with label display format using the same API to show Wind Speed (mph).
The Sailboat hire form looks like below at run time.
Over the coming months, we will be adding additional capabilities to the SQL Request and Web Request control to further enhance the capabilities for you to use in your Enterprise Forms.