Hey all!
So I've been looking for a way to create a search field in Nintex forms that looks up values from another list where they contain the text entered into a text box. Today I came across this fantastic post which brilliantly solves my issue!!
Nintex Form search field
I still have one small problem, I'm no good at JavaScript... but I'm learning! So all works perfectly as long as the lookup is on the source list's Title field but the moment I change the JavaScript to reference a different field it just loads without returning anything, I'm obviously doing something wrong but not sure what.
This is the Custom JavaScript used, instead of Title I'd like to return the values in the BMC_Description column:
NWF$(document).ready(function() {
//The source data for the autocomplete is the GL Material Groups list
//Store the titles in a array variable
var itemsReturnedVar = [];
NWF$().SPServices({
operation: "GetListItems",
async: false,
listName: "GL Material Groups",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>", //the name needs to be changed accordingly
completefunc: function (xData, Status) {
NWF$(xData.responseXML).SPFilterNode("z:row").each(function() {
itemsReturnedVar.push(NWF$(this).attr("ows_Title"));
});
}
});
//ControlVar is added on the control in the NF
NWF$("#" + ControlVar).autocomplete({
source: itemsReturnedVar
});
});