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

Rules and Actions

To populate the text box in the same row of the repeating table, open the properties dialog window of the drop-down list.  On the Data tab click on the Rules button.  We need to add two rules.  The first will set the value of the hidden field to the selected value of the active drop down list.  The second will use the hidden field value to filter the secondary data source and set the text box with a sibling node value.

Add a rule and then add a Set a field’s value action to the rule.  Select the hidden field as the field and set the value to the drop-down list’s current value (see Figure 1).  Click OK a couple times until you are back to the Rules window.

Figure 1
Figure 1

Add a second rule and then add another Set a field’s value action to this new rule.  Select the repeating table text box as the field.  To set the value click on the function button select Insert Field or Group and navigate to the secondary data source field you want the value of.  Then click on the Filter Data … button.  Add a filter to reflect the following condition:

[Secondary data source drop-down list value field] = [hidden field value]

Click OK a couple times until you are back to the Action window (see Figure 2) and then click OK a few more times to exit the drop-down list’s property dialog.

Figure 2
Figure 2

When you preview the form, you can now supply a parameter value to a web service.  The web service then populates the drop-down list in a repeating table row.  Select a value from the drop-down list and the text box in the same row will be populated with corresponding information.  This will work for every row added to the repeating table.


View Entire Article

User Comments

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

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-16 3:16:36 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search