brendalee
Nintex Newbie

Best method for populating drop down on NewForm when rendered to user

Jump to solution

We are migrating Lotus Notes forms to Nintex Forms and Workflow 2010.  The Notes forms have custom code which call web services to build drop down lists (for department, location, all employees).  We want this same functionality on our Nintex Forms - prepopulated drop down lists.  What is the recommended method for reading web services and populating a drop down list at the time the form is rendered to the user for use?  The data can be pulled back using SQL statement to database also.

0 Kudos
Reply
9 Replies
xMikeX
Automation Master
Automation Master

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

Hello,

There are couple of ways to do it - here are the methods:

1)  You could create lists to store this information and have a workflow that runs and synchronizes the data as a sort of batch / scheduled operation throughout the day.  Your workflow would make the WS calls or DB calls as needed.

2) You could write Javascript to make these calls from your form.

3) This paid addon allows you to make these calls directly from your forms: Nintex Add Ons | ProSymmetry

Thanks

Mike

View solution in original post

Reply
johncharles
Forms Fledgling

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

Hello Brenda,  I am also converting Lotus Notes Applications with Forms - except with Nintex 2013 and SharePoint 2013.  Depending on your scenario, it may not be necessary to use Web Services.  Wherever you have a Lotus @DbLookup to look up Keyword lists etc, you can simply do exactly as Mike says above, put those values into a SharePoint Custom List (on the same site).  Create a Nintex Form and use the List Lookup control:

This will allow you to lookup lists on your Sharepoint Site.  Emily did a great description of this here: Cascading drop downs and Nintex Forms for SharePoint

Reply back if you are using Web services from another source, i.e Websphere - You probably do need to use Javascript or Jquery then.  // John

Reply
brendalee
Nintex Newbie

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

Our Lotus Notes forms - the developer that wrote the forms is calling a web service - not familiar with his process.  I do know he is using Java to call it - but I do not know if he is using Websphere.  The issue is the amount of data - we have over 1700 departments and several hundred Campuses or Locations.  If you have a look up list, how will you find the department or campus quickly and easily.  In a .NET application we would use the jQuery autocomplete function on a text box.  In the Nintex/SharePoint environment, I am so new I do not know the best option.  We were looking at building a term store - but we need to update it every day.  No we don't change every day, but in 7 years we have renamed all departments several times and added / changed the department list.  A type ahead would be perfect for us. Any experience with it?

0 Kudos
Reply
brendalee
Nintex Newbie

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

Is it possible to use jQuery and have a type ahead function?  I will check out the paid add on now too.  Thanks.  (See my comment below on another post about our volume of departments - over 1700!!!)

0 Kudos
Reply
xMikeX
Automation Master
Automation Master

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

Yes, I've used JQuery to get some type ahead functionality before so I know it can be done. 

0 Kudos
Reply
brendalee
Nintex Newbie

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

Do you have any examples to follow or a link to a tutorial on succesfully using autocomplete (type ahead) on a text box that is reading a lookup list?  I am making an assumption that this is what you did ... Thanks!

0 Kudos
Reply
brendalee
Nintex Newbie

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution
Reply
johncharles
Forms Fledgling

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

Hi Brenda,

Your link looks really good - I will use that Myself!

This example is not inside Nintex Forms yet - Mike's example will probably help more.

But to help for now - Here's some Jquery Code to Autocomplete a Normal input box against a SharePoint list on the same site.  I put in variables to simplify as much as possible.  Store this in an HTML page in Site assets and link to it from inside a Content Web part.  It also works as a plain html page looking up Sharepoint values.

<!doctype html>
<html lang="us">

<head>
<link href="http://YOURSITEHERE/Javascript/jquery-ui.css" rel="stylesheet">
<style>
body{
  font: 75% "Trebuchet MS", sans-serif;
}
.demoHeaders {
  margin-top: 2em;
}
#dialog-link {
  padding: .4em 1em .4em 20px;
  text-decoration: none;
  position: relative;
}
#dialog-link span.ui-icon {
  margin: 0 5px 0 0;
  position: absolute;
  left: .2em;
  top: 50%;
  margin-top: -8px;
}
#icons {
  margin: 0;
  padding: 0;
}
#icons li {
  margin: 2px;
  position: relative;
  padding: 4px 0;
  cursor: pointer;
  float: left;
  list-style: none;
}
#icons span.ui-icon {
  float: left;
  margin: 0 4px;
}
.fakewindowcontain .ui-widget-overlay {
  position: absolute;
}
select {
  width: 600px;
}
</style>

</head>
<body>
<div>
<input id="autocomplete" title="type &quot;a&quot;">
</div>

<script src="http://YOURSITEHERE/jquery.js"></script>
<script src="http://YOURSITEHERE/jquery-ui.js"></script>
<script type="text/javascript">

<!-- Use these variables to lookup against any list on your site -->

var SITE_URL = "http://YOURSITEHERE/ "
var LIST_NAME = "Drinks"  <!-- I use this as an example, just a standard SP list with Title and ingredients columns -->
var listArray = [];
$( "#autocomplete" ).autocomplete({
source: listArray
});

    $(document).ready(function() {
        var soapEnv =
            "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                <soapenv:Body> \
                     <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                        <listName>"+ LIST_NAME + "</listName> \
                        <viewFields> \
                            <ViewFields> \

<!-- Here is where you put the fields to retrieve -->
                               <FieldRef Name='Title' /> \  
                               <FieldRef Name='Ingredients' /> \
                           </ViewFields> \
                        </viewFields> \
                    </GetListItems> \
                </soapenv:Body> \
            </soapenv:Envelope>";

        $.ajax({
            url: SITE_URL + "/_vti_bin/lists.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            complete: processResult,
            contentType: "text/xml; charset=\"utf-8\""
        });
    });

  

<!-- Below is where you put the OWS value of the fields to retrieve -->

function processResult(xData, status) {
        $(xData.responseXML).find("z\\:row").each(function() {
            var listValues = $(this).attr("ows_Title") + " - " +$(this).attr("ows_Ingredients") ;
            listArray.push(listValues);
        });
    }
</script>
</body>
</html>

Hope this is of use...

0 Kudos
Reply
jose_fidalgo
Cloud Wanderer

Re: Best method for populating drop down on NewForm when rendered to user

Jump to solution

The problem with this is that it does not work within repeat section.
Javascript does not work very well on this object
I need a solution for this, but unfortunately I can not find

0 Kudos
Reply