Retrieve cities from a database

  • 26 October 2015
  • 0 replies
  • 9 views

Badge +4

Nintex Forms Enterprise Edition

 

This tutorial walks through steps to retrieve country and city data from a SQL Server database and filter the returned city data based on the selected country.

131229_pastedImage_1.png

Figure: Example of a form listing cities for the selected country; if another country is selected, the list of cities is updated.

 

Prerequisites:

  • Database table "Cities" containing two columns: Country and City
    Example:
    131230_pastedImage_17.png
  • Secure Store target application ID for credentials to the SQL Server database
    For more information on Secure Store, see the Microsoft article Configure the Secure Store Service in SharePoint 2013.
  • List columns for binding the value and display fields for each instance of the SQL Request control (optional)

 

Steps:

  1. Add the SQL Request form control for "Country" and apply the following configuration.
    Field Value Notes
    Name Country  
    Display format Drop down list  
    Query type SQL  
    Query

    SELECT [Country]

    FROM [CrestanDemoData].[dbo].[Countries]

     
  2. Add the SQL Request form control for "City" and apply the following configuration.
    Note: Red text indicates inserted references.
    Field Value Notes
    Name City  
    Display format Drop down list  
    Query type SQL  
    Query

    SELECT [City]

    FROM [CrestanDemoData].dbo].[Cities]

    WHERE Country='Country'

    To insert a reference to the "Country" control, select it from Named Controls in the Insert Reference dialog box.
  3. Publish the form and you're done!

0 replies

Be the first to reply!

Reply