cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
chanteldup
Nintex Newbie

Nintex Form search field - Return items that "Contains" value

Jump to solution

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 
});
});
Labels: (1)
Tags (2)
0 Kudos
Reply
4 Replies
emha
Nintex Newbie

Re: Nintex Form search field - Return items that "Contains" value

Jump to solution

have you noticed the field is refereed twice there?

0 Kudos
Reply
chanteldup
Nintex Newbie

Re: Nintex Form search field - Return items that "Contains" value

Jump to solution

I did but since I am not experienced in JavaScript I wouldn't be able to tell you why, what I can say is that if I change the first Reference to my Column that I want to retrieve it has no effect and all still functions as if it were referencing the Title field, if I change both to the desired column name then all stops working... like it's trying to load data but can't...

 

This is why I was hoping someone who understands JavaScript could advise what I'm doing wrong. 

0 Kudos
Reply
emha
Nintex Newbie

Re: Nintex Form search field - Return items that "Contains" value

Jump to solution

javascript seems to be correct. it works for Title after all, as you said.

the only issue is to correctly supply field name.

 

as a fisrt step try:

- replace 'Title' with 'BMC_Description' in CAMLViewFields definition

- replace 'ows_Title' with 'ows_BMC_Description' in response processing function

0 Kudos
Reply
chanteldup
Nintex Newbie

Re: Nintex Form search field - Return items that "Contains" value

Jump to solution

So I tried som other columns and all seem to work except the column I need... thanks murphy! Recreated the column and boom, it's working. Sadly I have no idea what was wrong with it though...

0 Kudos
Reply