Solved

InfoPath lookup field to SharePoint

Posted on 2012-12-25
6
2,046 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
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.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
Viewers will learn the different options available in the Backstage view in Excel 2013.
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…

914 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

19 Experts available now in Live!

Get 1:1 Help Now