Skip to main content
Nintex Community Menu Bar

Using list view in Nintex form to populate controls

  • June 3, 2015
  • 19 replies
  • 78 views

Forum|alt.badge.img+8

Is it possible to use List View in Nintex form to populate controls? I want to implement this functionality that when a user selects an item in the list view, the system populates a text box with information from the selected record.

19 replies

Forum|alt.badge.img+8
  • Author
  • June 4, 2015

What I mean is, for example look at this form:

r.PNG

I want when the user selects an item, it'll take the order_number from the list view and populate it in the form control.


Forum|alt.badge.img+9
  • Nintex Partner
  • June 4, 2015

I think that it is possible by using a calculated value. In the formula of this calculated value, you can use the lookup function to get the order number of the selected item. Then to display the result of the calculated value in your field, look at this :

Re: Using Nintex Form Runtime Lookup Function to populate a textbox

To hide your calculated value, you can use a formatting rule which condition is : true.

 

Hope this helps


Forum|alt.badge.img+8
  • Author
  • June 4, 2015

I have tried it however, it doesn't recognize my control's ID. It says its undefined? although I've set it.


Forum|alt.badge.img+9
  • Nintex Partner
  • June 4, 2015

Can you give me more details ?

Which formula have you populated in the calculated value ?


Forum|alt.badge.img+8
  • Author
  • June 4, 2015

this is the formula: setmycontrol(lookup("ContractsList", "ID", order_number, "Order_number"))

where contractslist is the list title, ID is the column, order_number is the id value, order_number is the output i want to get from the list.

and this is the JS function: 

function setmycontrol(value)

{

NWF$('#' + myControlID).val(value);

}


Forum|alt.badge.img+9
  • Nintex Partner
  • June 4, 2015

Have you tried the formula without "setmycontrol" to test if it correctly shows the order number in the calculated value control ?

In the settings of your control "order_number", have you configured the field "Store Client ID in javascript variable" to "Yes" and the field "Client ID Javascript variable name" to "myControlID" in the Advanced section?


Forum|alt.badge.img+8
  • Author
  • June 4, 2015

yes, now after I did that, it shows and disappears the calculated value. also, the lookup control value resets.


Forum|alt.badge.img+9
  • Nintex Partner
  • June 4, 2015

It disappears? That's strange.

When it shows something, does it show the expected value in the "order_number" control ?


Forum|alt.badge.img+8
  • Author
  • June 7, 2015

I run the lookup function without calling the JS script and I get no result, this is the function I used lookup("ContractsList", "ID", order_number, "Order_number") but when I set the order_number value manually it returns a result.  I have ensured that I'm using the same data type as in the list.


Forum|alt.badge.img+8
  • Author
  • June 7, 2015

The problem was in retrieving value from the lookup control without using parselookup function. It's all good now.


Forum|alt.badge.img+8
  • Author
  • July 1, 2015

I've used JS


Forum|alt.badge.img+9
  • Nintex Partner
  • April 14, 2016

Actually, it's easier to use a list lookup to perform that instead of a list view... In the list view, you cannot get the selected item without javascript (you can assign a css class to the list view and get it from there but it's more complicated).

If you'd like to display other columns in the list lookup, you can do it using Javascript when the form loads and when the list lookup has loaded all the items (the list lookup is displayed as a table, you can append <td> to add columns and query the columns you'd like to display in javascript using the id of the item which you can find in the value of the checkbox).

Don't hesitate if you need more help, my explanations may be confused...


Forum|alt.badge.img+9
  • Nintex Partner
  • April 14, 2016

That's great happy.png

Unfortunately, i don't know any article that deals with something similar...


Forum|alt.badge.img+11
  • Nintex Partner
  • March 20, 2017

Hi Caroline,

Would you have a JavaScript code snippet that shows how to extract the selected item in a List View? If only I could get the ID, that would be sufficient. I've a requirement where the user would like to copy metadata from another document in a library. Unfortunately there are too different filters required to implement this with views and/or the available lookup filtering. Using the List View, the user would be able to easily filter it, select the proper item and pressing a JS button on the Nintex Form would then do the rest to read the metadata of the selected item and populate them into the new form.

Thanks in advance.

PS: I've also voted for multiple filtering of the List Lookup control. A variation would be to also be able to specify a CAML Query based on control values on the form.


Forum|alt.badge.img+9
  • Nintex Partner
  • April 13, 2017

Hi Jean-Pierre,

Sorry for the delay.

Unfortunately I haven't done that before and don't have a javascript code to share.

Have you been able to do it?


Forum|alt.badge.img+11
  • Nintex Partner
  • April 13, 2017

No problem Caroline,

In the end I implemented this using JavaScript to both construct a CAML query from filters to reduce the actual selection dropdown list, as well as read and copy metadata from the actual selected item into the current form's properties. Which works like a charm now grin.png In the process I also resolved the issue with the List Lookup dropdown occurring as of NF v2.9-ish; it seems around one of those updates the Nintex team changed the control order of the <select> and <input> items......


Forum|alt.badge.img+9
  • Nintex Partner
  • April 13, 2017

Great, thanks for your feedback ! happy.png


Forum|alt.badge.img+3
  • August 26, 2019
I have this exact scenario however I am not seeing any runtime function which lists the ID's of the selected items in the list view. Am i missing something??

Forum|alt.badge.img+3
  • August 26, 2019
Would you mind sharing your JS for it?