Showing results for 
Search instead for 
Did you mean: 
Nintex Newbie

Set default value of List Lookup control using QueryString parameter

I'm new to Nintex, so I'm hoping someone will be able to help. I'm sure I'm not trying to doing anything that hasn't been done before. 

Issue: I am unable to set the default value of a List Lookup control from a QueryString parameter, on the NewItem form, running on IE 11, eventhough, I can set the default of a Single Line Textbox control. I have verified that I can read the querystring and return the correct parameter value. I am able to decode the querystring parameter to replace %20 with spaces, etc.  Because I am using IE 11, I understand that I can't use the javascript find() method, to retrieve the ID for the text value of the parameter string. I’ve tried passing both the parsed parameter string value, as well as a hard-coded record ID, but neither changes the List Lookup field, even if I could retrieve the record ID. 


Form has a List Lookup control called JobTitle. JavaScript variable name is defaultJob. And, a Single Line Textbox control called txtJob. JavaScript variable name is qsJob

JobTitle List Lookup.pngtxtJob Single Line Text.png














This is the Javascript:

NWF.FormFiller.Events.RegisterAfterReady(function() {
var paramJob= JSRequest.QueryString['Job'];
alert("paramJob is empty");
paramJob = paramJob.replace(/%20/gi, " ");
paramJob = paramJob.replace(/%2D/gi, "-");
var ddlJob = NWF$("#" + defaultJob);
var tbJob = NWF$("#" + qsJob);
alert("ddlJob = " + ddlJob.val());

Here is a sample of the QueryString:




The parsed querystring parameter for 'Job' reads 650258%20%2D%20PC%20Tech

After it's decoded it reads 650258 - PC Tech

The ID for this list item is 328


Thank you in advance for your suggestions!





Labels: (1)
0 Kudos
1 Reply
Nintex Newbie

Re: Set default value of List Lookup control using QueryString parameter

Try this,
var value ="Job in the list" - should be the value without id.

NWF$('#' + defaultJob ).parent().find('select').find('option:contains("'+ value +'")').attr("selected", true);
NWF$('#' + defaultJob ).parent().find('select').change();
0 Kudos