SQL Request Control – Cascading Multiple Fields from SQL Database Table


Badge +1

Using Nintex Forms 2013 on-premise, I created a form and set a SQL Request Control to display customer’s ID from SQL database table.

Upon ID selection (field: customerID), I need to pull back 3 other fields. customerFirstName, customerLastName and customerEmail. All fields reside in same table.

 

SQL Request control works fine returning a single value such as:

Display field:   customerID

Returning:       customerLastName

But it doesn’t work at all when I try to return multiple values such as:

Display field:   customerID

Returning:       customerLastName, customerFirstName, customerEmail

I used SQL query with Concat() option and tried selecting fields using Alias name (to be used in Value field). All failed.

Can it be done?

How can I resolve this issue?

Thanks

Eric


11 replies

Badge +10

Hi Eric,

You can use

select customerLastName + '-' +  customerFirstName + '-' + customerEmail AS CustName from Customer

Badge +1

Thanks Mathew.

It works fine now.

Eric

Badge +5

Hi Eric

Can you please add a screen shot of this working? I am trying to do the same.

Thanks

Badge +5

Hi Sojan

Can you please share a screenshot of this working?

Thanks

Badge +10

Hi Abhi,

what screen shot do you want

Badge +5

Of the action please if you can.

Badge +1

Hi Abhi,

Unfortunately that was a project for a client. data is not available to me anymore.

I wish I had a snapshot.

I apologize.

Eric

Badge +5

Hi Eric

Where can I input the formula above?

187832_pastedImage_0.png

Badge +10

Hi Abhi,

If it is a stored procedure, it should be inside the procedure , or if you are using the sql query you can use it directly on the sql query.

187825_pastedImage_0.png

Badge +3

Hello Sojan Mathew‌,

I am having a problem on environment using this kind of query to return the results on query type as your example.

SQL Request Test

When running the TEST query it returns values just as SSMS returns the same values. However, when query from the form preview or after publishing this appears to not work.

SQL Request Form View

I am almost wondering if I should open a ticket in regards to this issue. I don't see anything not allowing this to work appropriately. When I do simple query like:

Select EmployeeID from Employees

This returns the values as expected on the form. I am stumped on this one. Anyone have any advice at this point?

Badge +3

I found the carriage returns were causing the query to break. I deleted the extra spaces and returns and the query started working.

Select FirstName + ' ' + LastName AS EmployeeName ,EmployeeID FROM Employees Where Active = 1 Order by 1

Hope this helps anyone with this issue!

Reply