Querying a SharePoint list from another list in Nintex Forms 2013 and 2010 is possible using the lookup control, but how do we achieve this in Nintex Forms for 0ffice 365?
We have an Inventory List. In the Inventory Form, we would like to have a lookup which loads a list of products. When the lookup value changes, we would like to query our products list and return all the details of the selected product.
var obj = NWF$("#" + LookupProduct);
var web = clientContext.get_web();
var oList = clientContext.get_web().get_lists().getByTitle("Products");
var listItem = oList.getItemById(this.value);
clientContext.load(listItem, "Title", "Code", "Price", "ImageUrl");
var img = NWF$("#image");
var code = NWF$("#" + ProductCode);
var productPrice = NWF$("#" + ProductPrice);
var productName = NWF$("#" + ProductName);
var imgUrl = listItem.get_item('ImageUrl');
var imgUrlTextBox = NWF$("#" + ImageUrlVal);
Referring to the snippet above, basically we are querying our product list with the id from the lookup control and populating a few textboxes with the details of the selected product.
Using this same concept and applying JSOM we can achieve many SharePoint related operations in our forms that makes Nintex Forms for Office 365 even more powerful. However, some lists might not be able to be queried due to permission levels.
Enjoy exploring and give it a go to unleash the full potential of Nintex Forms. Comments and ideas are most welcomed.
Great that you have tried this, could you give me more info on your code so that I can check it out for you. If you are using the exact piece of snippet above, I believe you should not be getting any errors.
I am having a hard time getting this to work.
I am trying to pull all of the information in an Assets Off Boarding list that is assigned to a specific user.
I have tried to replace the information as suggested but the form will not even load in preview mode.
When I turn on the Dev Tool Bar it is not finding the NWF$ but when I view the source it is showing in the code. Additionally it is showing in a CDATA but rem'd out.
I could really use some additional help.
Does it work in runtime? Its hard for me to know where you are going wrong without additional information.
Would be good if you could share some code and the form xml so I can assist you.
had some trouble earlier but found:
This helped me understand the code much better and I was ultimately able to find where I'd gone wrong.
However my current issue is "what next?" I have all my code in place however my text boxes in the form named: "ManagementArea" and "BMContractor" are not updating when I am changing the selection in "LookupSite" look up field. The code is there but I cant see it doing anything, do I need to add code to the text boxes/fields on the form also?