InfoPath 2010: Showing the Display Name of a Selected Item in a Dropdown Menu in Forms Library
Sometimes there is a need to show the selected item of a dropdown in an InfoPath form in forms library under a column. The requirement could be anything e.g. a "List View" where that column in shown, custom reporting, workflow etc.
In such cases, of course users want to see the "display names" of the selected item of the dropdown instead of ID. As we all know that when we bind a dropdown in an InfoPath Form, we have 2 fields to bind - ID and Display Name. If we promote the dropdown field of the InfoPath form as a property in the library, it will show the ID, instead of the Display Name of the selected item.
In order to meet this requirement, follow below steps to show the Display Name of the item instead of ID:
1. Create a new field in the IP form for each of your dropdown.
2. Setup a rule of 'Action' type on your dropdown as follows:
A. Set Condition : None and Action as Set a field's value.
B. In the Field box: select the field which you created newly in step#1.
C. In the Value box > click fx > click Insert a field > select the data source (secondary) which you used to bind your dropdown.
D. Select displayname and then hit Filter Data... button.
E. Click Add... button.
F. Set value 'is equal to' Your Dropdown field.
G. Hit OK on all the open dialog box.
H. Execute the form locally.
Now, when you select a value in your dropdown, you see the corresponding display name in your new field. Once it's confirmed, you can remove this field from your form so that users don't see it.
After that, promote this field so that it's shown in the library.
Hope it helps.
Thanks,
Ashish Gupta