Solved

InfoPath lookup field to SharePoint

Posted on 2012-12-25
6
2,076 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
  • 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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 earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

803 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