Skip to main content

Nintex Forms Enterprise enables your forms to connect to external data sources, such as SQL databases or web services, extending their reach by automating the inclusion of relevant information. In this post I will explain the power of SQL Request Control to query warehouse data from an external SQL Server data store in order to build a Product Order Form.

100928_pastedImage_2.png

The SQL Request control simplifies connecting to a SQL Server database by configuring basic information such as Server Name, Database Name and Authentication mode (Anonymous, Windows and SQL). This Control supports multiple display formats similar to Nintex Choice Control - Option buttons, Checkboxes (Multiple Selection), Dropdown list or Text/Label. The SQL Request control leverages the SharePoint Secure Store Service in order to protect the SQL Credentials, which we would also recommend are configured under least privilege principle. 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.

 

For this Product Order Form, we will be displaying a list of products as Option buttons available for selection. This form will use the Northwind database with a stored procedure "GetProducts", specified in Stored Procedure Name field. This stored procedure returns a list of items ( Product Names and Units in Stock) from the Products database.  The "Display Field" property allows designer to specify which result column to be displayed on the form. The "Value Field" allows to set the column name, value of which will be retained when an item is selected. For the order form I have selected "ProductName" column values to be displayed on the form and "UnitsInStock" (available units in warehouse) column values to be retained when a product is selected.

 

100929_pastedImage_8.png

The "Run Now" button in the ribbon displays the Run Now dialog box. This dialog is designed to test database connection and test the query at design time.

The Test Result table displays query execution results.

 

100930_pastedImage_13.png

The output from this control will be displayed as Option buttons as below.

100931_pastedImage_18.png

Now when an item is selected the Units in Stock will be retained as "Value Field". You can now add a calculated value control on the form to display this value. Using parseLookup() runtime function as the "Formula" of calculated value control the "Value Field" information can be extracted.

100932_pastedImage_25.png

100933_pastedImage_30.png

The simple order form built using above:

100934_pastedImage_35.png

You can now introduce other Nintex Form features such as custom validation/ rules to build smart forms. In this case I have added a simple business rule to avoid ordering product if the order quantity exceeds the units available in warehouse.

100935_pastedImage_52.png

As you can see, the SQL Request control opens up a number of valuable scenarios where you may want to bring data into your forms directly from a SQL database without encoding it within a workflow, or managing another set of reference data. 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.

Hi Sojan,

I actually found this a few days ago also and I raised it as a bug.  So the development team is aware of it.

cheers,

Vadim


Thanks Vadim, Quick reply, Any idea when will it be fixed.


Hi Sojan,

Don't know I'm afraid.  I only logged it a few hours ago.  But that will give it visibility.

Fingers crossed my friend.

If it's affecting a production form you are building, shoot support an email and that will raise it higher.

Vadim


Hi Vadim,

Any update on this feature.

Thanks,

Sojan


Hi Sojan,

Unfortunately the current version of SQL request control is not designed to work with dynamic filters when used in repeater. However our product team has prioritized this request and we are aiming for delivering this in July release of the product.


Thanks Hemang, Really waiting for that. Good to know that it is going to be in July release.

Sojan


Any particular reason windows authentication only works with the secure store service? With the workflows you can do the sql request using a secure store or a workflow constant credential. Getting a secure token set up in our environment is time consuming.


Question: On my form I have to populate a drowdown list with our customers' info, which resides in Oracle. Does Nintex Forms 2010 do that directly with or without the "SQL Request" addition, or do I need to use something like a Linked Server in SQL to grab the data, then query THAT?


12 months on and this is still the case. I created a form that allowed users to search for customer using a free text query that works great. When they select the correct user from the SQL Request dropdown a bunch of other controls go away and get the rest of the customer info. a total of 7 SQL requests to retrieve the info.


Hello Ryan,

I'm using a similar way to yours,

there is a way you can minimize the SQL controls use,

if the customer info you retrieve from the database are connected to the same ID,

you can configure the SQL Control to send the customer ID to your procedure and retrieve two columns from the database (field1,field2) instead of (ID,field2)

then connect a calculated field to the SQL control to retrieve field 1 or field2.

this way, you can cut down the SQL controls in your form to half.

i know this not what you are looking for,

but when "saving without closing" is implemented, i believe it will solve a major part of this issue since you can use a web request to retrieve all the data you need and connect it to a repeating section and configure all the fields inside it.


With Microsoft introducing the Cloud Gateway for on premise servers to allow data connections to things like PowerBI, PowerApps, Flow etc, are we getting any closer to investigating a solution from Nintex to allow the SQL Request control to work in mobile.


My SQL request is working when I click run now, but will not work on the actual form? Any advice? I posted screen shots here..

 


I am trying to write to SQL table. I have a table "bJCJM" where i have columns Job (job number) and JCCo (company number). I want to validate a entry from nintex form against Job if Job (job number) already exists.

I am even struggling to show fields on preview.


Hello SP P‌ - Its best for you to pose this as a question in the Getting Started forum.  Just click on Actions > Question as shown below.  This way community members can respond directly to your question.  Please include some screenshots of your form and/or how you configured the SQL Request control.


Thank you Tom, will do so.


Is there a way to introduce a delay while calling the procedure withing the SQL request, as some parameters are used based on other run time sql request from the interface. 

Can we control the on load sequence of the SQL requests.

please refer to below question for more details.

 


Hi Shaker,

Maybe use the WAITFOR command in SQL : https://docs.microsoft.com/en-us/sql/t-sql/language-elements/waitfor-transact-sql

I've not tried this, but sounds like it's what you need.

Vadim


The main problem is that: Just need to control the sequence of the SQL request execution while the form is loading.

This is the main issue, which I think it should be controlled from withing nintex side.


then if the last producer is delayed, while execution, still the parameters needs to be filled before logged into the procure itself.


Is there a way to populate a SQL request control by using a JScript on run time, 

I tried below but it doesnt work..

NWF$('#' + jsvalAmt).val("500");

???

Hemang Shukla


Vadim Tabakman Any updates?


This was resolved by setting the dropdown list SQL request control to be in New and edit mode, since it was only in New mode only


I'm afraid I've never tried that sorry.  So I don't know the answer to this.

Vadim


Is there a way to run the validation on expression in edit or new mode: 
by accessing the values of items in Named control,

which means the for still submitted yet.

Or can we run a javascript function.


Does the SQL request field works when it is published on an external facing form that has anonymous users submissions? 

It worked perfectly fine when using it for authenticated users but once we enabled anonymous submissions the fields come back as blank. I'm wondering if it is an authentication problem! 

‌, ‌ ? Sorry, for tagging you, but we really need an answer from some trusted people who might knows how this should work..  


Reply