Solved

InfoPath lookup field to SharePoint

Posted on 2012-12-25
6
2,020 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
Comment Utility
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
Comment Utility
clayfox,

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

Expert Comment

by:clayfox
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 1

Author Comment

by:MSOfficeExpert
Comment Utility
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:
teylyn earned 500 total points
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now