This project has moved and is read-only. For the latest updates, please go here.

Auto population?

Sep 20, 2013 at 1:23 AM
Edited Sep 20, 2013 at 1:41 AM
I've been looking for a means to auto populate a field based on a value on another field. Although a bit similar to a cascading drop down the cascading drop down doesn't really pre-selects a value among the list.

I've also considered Auto-complete but I'm looking for something that directly manipulates the value of a certain field.

I'm thinking of linking the Employee number to the personal details of concerned person and since EE numbers are often unique, the values should be predetermined once the correct EE number is entered.

Would there happen to be some info regarding Auto Population as well as making a certain column read only as well?

And just for curiosity is it possible to implement multiple solutions like cascading drop down and display related info simultaneously in a single form or even a single column? I may be biting more than I can chew here, but just like the lottery you cant win if you don't try. right?

Thanks in Advance.
Sep 20, 2013 at 3:07 AM
If you can think of it, you can build it. SPCascadeDropdowns is a collection of calls to GetListItems and a few other operations, along with knowledge of the structure of the columns desired.

Marked as answer by Francisism on 6/4/2014 at 3:13 AM
May 9, 2014 at 11:46 PM
Edited May 10, 2014 at 12:12 AM
Hello again SP Services Folks,

It took me a while to find away to accomplish this functionality but thanks to the you guys and a few blogs found by google, I manage to figure out a way to get the Functionality I wanted to implement. (Learning about DOM helped me understood a lot of the codes that looked foreign to me at first)

The functionality I used was GetListItems as suggested by Mark. At first I didn't understand how to configure it but thanks to some folks posting their questions as well as the codes they used and the corrected versions of the codes but taking what their working codes and building from it helped me collect fragments of knowledge that would later influence me on this simple code.
<script language="javascript" type="text/javascript" src="Mysite/JQueryLibraries/jquery-1.7.2.min.js"></script> 
<script language="javascript" type="text/javascript" src="MySite/JQueryLibraries/jquery.SPServices-2013.01.min.js"></script>
<script language="javascript" type="text/javascript" src="MySite/jQuery%20Libraries/jquery.SPServices-0.5.4.min.js"></script>
<script language="javascript" type="text/javascript">
      // Title will be later changed to EE number

function StatusChange()
       var thisVal =  $("input[title=Title]").val();
       //The title is stored on a variable to be used on the query string formula below
       var query = "<Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" +  thisVal +"</Value></Eq></Where></Query>"
           operation: "GetListItems",
           async: false,
           listName: "EmployeeList",
           webURL: "MySite",
           CAMLQuery: query,
           CAMLViewFields: "<ViewFields><FieldRef Name='EmployeeName' /><FieldRef Name='DataX' /></ViewFields>",    
           completefunc: function (xData, Status) {
                    $("input[title='Employee Name']").val($(this).attr("ows_EmployeeName"));
I tried using AutoComplete functionality but it doesn't seem to have completefunc options according to its documentation. Also when I used the SpAutoComplete functionality the event listener doesn't seem to capture the change that occurs on "Title" Field anymore.

I'm ok with the current functionality but being able to get the AutoComplete Function to work alongside the GetListItem call might make this small project from good to great.

Thanks again to all you Folks and once again any advice and guidance will be appreciated.

May 12, 2014 at 3:15 PM

I'm having a little trouble figuring out what you're trying to accomplish here. It looks very similar to cascading dropdowns to me, i.e., what you enter a value in the Title column, you're setting the Data2 column based on a relationship maintained in the EmployeeList list. On the other hand, that almost sounds like what a People Picker does for you.

May 13, 2014 at 10:26 PM
Edited May 14, 2014 at 4:44 PM
Hi Marc,

In a sense this code sort of function like a People Picker where the "Employee Number" is used to query other data. We needed to fetch other data that isn't available in our LDAP. And fetching it from a List we can manage would allow us to manage and control what information can be found on our list as well as who has permission to access the list since we have members on our Team who are in charge of maintaining the entire Employee List.

Ideally people here would want some of the Employee information fetched thru SAP but it's likely that no one here has the know-how to integrate those two Systems yet.

As a small project on it's own the ability to fetch 15-20 Personal Details of an Employee and have those values populate the forms based on the Employee Number entered will definitely speed up any inputting process involving those data.

Also the people here sort of use the data gathered in this list for their reporting and it seems that the number of Look Up Columns that should be displayed in a List Display Web Part is limited to 6 Columns according to the warning prompt that I received when I tried to display data from a list consisting mostly of Look up Columns.

If I were to pursue improving this thing here, Would it be possible to bind and fetch data based on two fields at once for example "Employee Number (Text Field)" or "Employee Name (People/Groups Field)"