cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set the default value to first item in filtered list lookup

Jump to solution

Greetings all,

I am trying to automatically display the first user(item) in the list lookup after filtering with another list lookup. How can we set the default value as the first item in the list lookup after the filter? Is it possible to do it?

Reply
19 Replies
murphybp2
Nintex Newbie

Re: Set the default value to first item in filtered list lookup

Jump to solution

Yong, not entirely sure I understand your scenario.  Are you talking about a lookup column that you're using on a Nintex Form?  Or are you referring to using a Query List action in a workflow?

0 Kudos
Reply
Not applicable

Re: Set the default value to first item in filtered list lookup

Jump to solution

Hi Brendan, I wanted to have a dropdown list (list lookup, in this case) that will always take first value available in the dropdown list as the default value because of multiple lookups I am doing. e.g. class level 1 -> class level 1.2 -> class level 1.2.3 -> assignee123.

So, the user filling up the form does not choose the assignee, but automatically shows one after he/she completes choosing class level 1, 2 and 3 lookups. Also, I may not need a dropdown list for assignee but what can I do? Thanks for reply

0 Kudos
Reply
murphybp2
Nintex Newbie

Re: Set the default value to first item in filtered list lookup

Jump to solution

So this is for Nintex Forms then?  Unfotunately we don't have Forms, so not sure how you'd accomplish that.  I know that with InfoPath you can create rules that perform actions on a field.  Do you have that option in Nintext Forms?  If so you could try and create a rule that populates the Assignee after each class has been selected.  And as part of the rule use a formula to pick the assignee you want from your lists.

0 Kudos
Reply
Nintex Employee
Nintex Employee

Re: Set the default value to first item in filtered list lookup

Jump to solution

Not sure if this is exactly what you're looking for, but check out my blog post "Auto Populate a List Lookup Control in Nintex Forms".

http://techrhodes.wordpress.com/2014/10/06/auto-populate-a-list-lookup-control-in-nintex-forms

Reply
netsenthil
Nintex Newbie

Re: Set the default value to first item in filtered list lookup

Jump to solution

Dear Eric,

I am using Nintex Forms 2013. I would like to set the first value of a lookup list as the default value. The example given in the blog did not work. When I set the below value in the Custom Javascript tab, the form did not load and I  could see only a blank page. I do have other scripts in the tab that are working in the tab.

NWF$(document).ready(function() {

NWF$("#" + ddldocumentlevel).val('1');

} );

Kindly help me on how this can be achieved. In Nintex 2010 the list look-up did not have the text "Please select" by default but now in Nintex 2013 it is available. But I would like to set a value from the look up data to be set as default

Reply
Nintex Employee
Nintex Employee

Re: Set the default value to first item in filtered list lookup

Jump to solution

Hi Senthil,

It might be that the quotation marks or the single quote marks come over inaccurately when you copy the script.  Try deleting and re-adding both the quotation marks around the # sign and the single quotes around the ID value.  Let me know if that works.

View solution in original post

Reply
netsenthil
Nintex Newbie

Re: Set the default value to first item in filtered list lookup

Jump to solution

Thank You Eric. It Worked!

Excellent support. Not expected to get a super fast response. Thanks a lot Eric.

Reply
Automation Master
Automation Master

Re: Set the default value to first item in filtered list lookup

Jump to solution

Hi,

is there a way to set default value if list lookup's display format is set to 'option butons'?

solution provided here seems not to work in that case.

Marian.

0 Kudos
Reply
Automation Master
Automation Master

Re: Set the default value to first item in filtered list lookup

Jump to solution

Hi Marian,

The following code is ok if you click a button but not in the Form Settings because the lookup values are not fully loaded. Even NWF.FormFiller.Events.RegisterAfterReady does not help.

In the Lookup COntrol setting, add .nf-LookupChoice in the Formatting Section, in regards of CSS Class

Here is the code

NWF$('document').ready(function () {

     NWF$('.nf-LookupChoice :radio').get(0).checked = true;

});

You can maybe write a code to wait until all the lookup values are loaded.

Best regards,

Chistophe

Reply