?
Solved

InfoPath lookup field to SharePoint

Posted on 2012-12-25
6
Medium Priority
?
2,170 Views
Last Modified: 2012-12-29
I have a SharePoint 2010 list, EmployeeList. It has fields EmpNo and Department.
I have another list, Drivers in the same site and it also has EmpNo along with other informaiton.
I would like to create an InfoPath form to enter new drivers.
In it, I would like a drop-down for the DriverID field and a text box for Department. The driver id is the employee number. Therefore, the drop-down in DriverID should display all values from EmpNo in EmployeeList. In the form, as soon as I choose one employee number from the drop-down in DriverID, I want the Depatment text box to automatically populate with the corresponding department from EmployeeList.
How can I achieve this?
0
Comment
Question by:MSOfficeExpert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 28

Expert Comment

by:clayfox
ID: 38720440
You need to research "cascading dropdowns" and filters.

Good examples at www.infopathdev.com

You will create a data connection to the drivers list

Set up 2 dropdowns
have the second dropdown use the driver list
But have a filter so that empid equals the field of the first dropdown.
0
 
LVL 1

Author Comment

by:MSOfficeExpert
ID: 38720446
clayfox,

Can you check the link, it doesn't lead me to "cascading dropdowns"
0
 
LVL 28

Expert Comment

by:clayfox
ID: 38720467
When you get to infopathdev.com search on cascading dropdowns, or you can on any search engine.

I am on my phone at the moment but there are several good tutorials.
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
LVL 1

Author Comment

by:MSOfficeExpert
ID: 38720478
I am looking for a solution in Experts Exchange. If I don't find one, I will research on my own.
0
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 2000 total points
ID: 38720513
Hello,

I don't know why you don't want to click a link to another web site, but if you insist:

In the InfoPath form, create a new data connection to receive data and point it to the Employee list. Make sure to include the fields for EmployeeID and Department. Give it the name EmployeeList

In your main data source, you need a field for DriverID and one for Department.

Drag both fields to the form.

Change the DriverID control to be a dropdown. Edit the control properties and click "Look up values from an external data source".

In the Data Source field, select the EmplyeeList data connection.
Set both the Value and the Display name to be EmployeeID and close the dialog.

Create an action rule on the DriverID field. The rule should fire whenever the field is changed.

Create an action to set another field's value.

Select the Department field in the Main data source as the field to be changed.

In the Value box click the formula button. In the next dialog click "Insert Field or Group".

Select the EmployeeList data source, open the Data Fields node and click on "Department" and then click the button "Filter Data". In the next dialog click "Add".

In the Filter dialog, set the first value field to EmployeeID of the EmployeeList data source: click "Select field or group", select the data source EmployeeList, open the Data Fields node and select the field EmployeeID.

Set the comparison operator to "is equal to".

Set the second value field to DriverID of the Main data source: click "Select field or group", select the Main data source and select the field DriverID.

Click OK on all the dialogs.

cheers, teylyn
0
 
LVL 1

Author Closing Comment

by:MSOfficeExpert
ID: 38729108
teylyn, I didn't want to click on the link because it leads me nowhere - the contents are unrelated to what I am looking for. Your solution - your detailed solution is exactly what I was looking for - Thank you!
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
This collection of functions covers all the normal rounding methods of just about any numeric value.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question