InfoPath: Populating Fields from Drop-Down Selection
page 2 of 4
by Michelle Beall
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 30648/ 71

Setting up the Example

Assume you want to call a Web service and pass in parameters supplied by the user at runtime.  The Web service will populate a drop-down list field in a repeating table.  The user should then be able to add rows at will to the repeating table and in each row make a selection from the drop-down list.  When the user selects an option, the corresponding repeating table row fields are populated with the correct data row values for the value selected. 

This example assumes the web service returns data in a structure similar to the following where all information related to a part number is in sibling nodes:

<font face="Verdana" color="black" size="2"><root>

Start by creating a new InfoPath project in Visual Studio.  In the InfoPath IDE add a text box, a repeating table with a drop-down list, and a text box with the following properties:

Text Box Name wsParam1
Data Type Text (string)
Drop-Down List Box Name field2
Data Type Text (string)
List box entries Lookup values in a data connection to the database, Web service, file, or SharePoint library or list
Text Box Name autofilledtext
Data Type Text (string)

Set up the drop-down list box to be populated dynamically at run time as described in Setting Secondary Data Source Web Service parameters using C# at runtime in InfoPath   We also need to add a hidden field to the main DOM with the following properties:

Name hdnSelectedVal
Data Type Text (string)

View Entire Article

User Comments

Title: great tip!   
Name: Schandmaul
Date: 2004-10-06 9:14:50 AM
thank you a lot

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2020  |  Page Processed at 2020-05-27 6:50:47 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search