I'm delighted to talk about the enhancements that have been done on the SQL Request and the Web Service Request component in Nintex Forms!
For those who have missed the last train, let me resume. Nintex Forms has a new young brother called Nintex Forms Enterprise! Nintex Forms Enterprise provides some new features, including the hability to load components from data retrieved from SQL Database or Web Service calls . You can read more about that on the following blogs :
Those controls have been requested by our partners and customers for a long time. Those components have been greatly appreciated in the community but some of you have noticed some limits in their usage, the main one being that the query was only executed once, on the loading of the form!
This blog is exactly about that point! With the new October release you will be able to add parameters to your Queries, parameters coming from the form itself. Let's dive!
Basically, with this new release, you won't see any changes in the designer itself, but when it comes to parameters!! To enlight it I will take two examples :
- Retrieving some data from a WebService Call and dynamically configure this WebService call
- Retrieving some data from a SQL Database and update the SQL query according to the content of the form.
On the example here, you can see Melbourne's wind direction only, but a nice thing would be to be able to choose the city dynamically with parameters coming from a Choice field that I have on my form. On the Service URL field, just click on the small icon beside the textbox and then you will see the improvment : now you get the "Named controls" tab that allows you to insert the value of your forms controls as parameters of your url. Before you could only do it with ItemProperties. Note that we also removed the "inline functions" tab that was useless in this context!
Let's give it a try!
On the previous example, I just replace 'melbourne' (which is a quite nice city by the way), by my choice field that contains a list of town (melbourne, paris, london, casablanca). I have now my service URL that looks like this :
After publishing the form ,you notice that whenever you change the value on the first dropdownlist, the form is Not updated, but the WebCall field is!
Let's now take a look at the SQL control with my second example :We will now try to get the List of cities from a SQL Database that is somewhere on my SQLServer.
I created a data table on my SQLServer called Cities containing 2 columns, "Country" and "City". then I populated the list with a few town starting by the most beautiful one (my hometown of course!)
Now in my form I have simply used the SQL Request component that I have put and configured like this (of course, CrestanDemoData, is the name of my SecureStore Application for which the credential have been configured for someone who has access to my DB also called "DemoCrestanData"):
Now If I simply save and run this I will show a DropDownList (cause my component has been configured to display a DropdownList, but I could have chosen to display it has Checkboxes, RadioButtons, Labels or textbox). But What if, now, I have a dropDownlist that already contains my country's names? How to make my SQL query change according to this field?
And just because I'm a bit lazy, obviously, you can imagine than the list of Countries itself I had picked it up from the same component, simply using the following Query :
And the result, is the one we expected (and of course there are no postbacks when you change the country value). Now when I change my countries, my city list is updated too!
The rest of the parameters from those controls remain unchanged, but this small improvement opens a lot of doors for the users!!
Have fun and thanks again Nintex dev team, you rock !!