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

Default selection for multi value List Lookup Control

Hi

I have a sharepoint list which has a lookup field which can contain multiple entries.  So in edit mode what my Nintex form shows for this field is a "List Lookup" control.  The issue is that I would like the control to start out with a default selection.

I've looked online to see how this can be done but the nearest thing I could find was this.  This doesn't work for me because I do not have a single drop down box.  The "List Lookup" control, when used on a field that can have multiple values selected is actually two select boxes with arrows between.  I looked pretty deeply into how Nintex does this and it uses Java script to move entries from one select element in response to double click or pressing the add/remove buttons.  This means I cannot simply modify these select elements, I need to use a similar mechanism that the complex control is using.

Does anyone know how this can be done?  I looked at the final code with a DOM inspector at how this was being done and I see that when e.g. "Add" is clicked there is a function called "GidAddSelected" or so.  I can't use this function because I haven't selected anything.  I suppose it would be possible to select the entries in the left select and then call this function to make the magic happen but this strikes me as a very nasty way to accomplish something that seems like a pretty obvious use case: I simply want to pre-populate the left side with default values.

I also looked at how to set the defaults in the sharepoint list... but the only solution appears to involve running jquery on the default sharepoint form.

P.S. Is there any documentation available for the Javascript API?  The only mention I could find was a link to an SDK msi zip file (p.p.s. msi files are already compressed so zipping them will either do nothing or make them even larger)!  First of all, documentation should be viewable in a browser without downloading anything (you can hide it behind a login if you wish).  Second of all, if you insist on having me download something it cannot be a zip or an msi.  Many large companies will not let you download zips.  Even more prohibit you from downloading an msi.  By having the file be both you practically gauarantee that I cannot download it.

Reply
4 Replies
Automation Master
Automation Master

Re: Default selection for multi value List Lookup Control

Can you share some screen shots to your form? Eric Rhodes​ has some great blogs and is a regular here as well, i'm so glad you linked his post on the lookup control.

There are a few places to review the NWF commands, I would start here Update fields before Submitting (Part 2)​ There is also other documentation on NWF that I didn't locate right away. I'll post back when I find what I have in mind.

0 Kudos
Reply
Automation Master
Automation Master

Re: Default selection for multi value List Lookup Control

Reply
gman
Nintex Newbie

Re: Default selection for multi value List Lookup Control

Jason,

We use consistently, in SP2013 on default forms, the SPService library along with jQuery library - both based on javascript. For example, to filter Locations based on a Section list. Both are multiple-selection lookup lists. It can also be used to select default values based on other field settings. Perhaps the same can work on Nintex Forms - I'd be interested in knowing the results.

The following content is added to the page as a Content Editor web part or as a Script Web part.

<script language="javascript" type="text/javascript" src="http://my.web.domain/Resources/jQuery/jquery-min.js"></script>

<script language="javascript" type="text/javascript" src="http://my.web.domain/Resources/jQuery/SPServices-min.js"></script>

<script type="text/javascript" language="javascript">

$(document).ready(function () {

// Set up the cascade from Section to Location based on the Locations list
$().SPServices.SPCascadeDropdowns({
relationshipWebURL: "http://my.web.domain",
// Identify the local list that maintains the relationship between Section & Locations
relationshipList: "Locations",
// Set the field name (in relationship list) for the parent column
relationshipListParentColumn: "SectionNames",
// Set the field name (in relationship list) for the child column
relationshipListChildColumn: "Title",
relationshipListSortColumn: "Title",
// Set the column name (in this list) for the parent column
parentColumn: "Section Names",
// Set the column name (in this list) for the child column
childColumn: "Location Names"
});

</script>

Here's a shot of the form with the cascading lookups working . . .

Hope this helps,

Gerard

Reply
Automation Master
Automation Master

Re: Default selection for multi value List Lookup Control

Gerard Rodriguez​ provides some great information here. Does this answer your question Jason Johnson​?

Reply