InfoPath Dropdownlist - value/display name question
-
Wednesday, June 01, 2011 2:22 PM
I have a list with columns called Director names and Division
I have a dropdownlist/combobox populated with the Division as the Value and the Director Name as the Display name.
When I choose a Director name from the dropdown, I populate a textbox with it's 'value' (the Division).
There is a Director name column in the library. However, when I submit the InfoPath form, the Director Name column gets populated with the Division (which is in the 'value'), not the Display Name of the dropdown.
How can I get the Display name to populate/get promoted in the library itself? (I hope this is clear)
All Replies
-
Wednesday, June 01, 2011 2:36 PMWhen you configured the drop down in InfoPath, did you specify which field to use as value and which to use as text (display)? By default, InfoPath uses the same.
AK -
Wednesday, June 01, 2011 2:40 PM
Yes - I've got the value set to Division and the Display name set to the Director Name.
However, when I submit the form to the library, the Division (which is the value of the Dropdown) gets inserted into the Director Name field in the library.
What I need is the Display Name of the Dropdown to be used when populating the Director Name column - not the value
-
Wednesday, June 01, 2011 2:57 PMOh, you have a director name column (from the library), are you binding it to the drop down in InfoPath? If it was originally a text box, you can have it populate on change (to the drop down).
AK -
Wednesday, June 01, 2011 3:04 PM
I have a separate list that I'm using to bind the dropdown list in InfoPath - - 2 columns - Name and Division
(Value - Division/Display Name - Director Name)
I have a Director Name column in the library itself - I need to populate that with the Display Name of the Dropdown
(right now, instead of the InfoPath DDL's display name, it's using the value to populate the Director Name in the library, and that's NOT what I want) -
Wednesday, June 01, 2011 3:19 PMThe dropdown is set to the value you gave it, which is Division, so it's working properly. YOu need to use a rule on the dropdown that sets the OTHER Director Name field to the Director Name value of the row selected in the dropdown.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force -
Wednesday, June 01, 2011 7:21 PM
that's the first part of the problem - I don't know how to access the DISPLAY NAME of the DropDown.....
in a formula, I access the dropdown field and all I get is the VALUE
I mean, what's the use in having a value and a Display name attribute, like in HTML or ASP.Net, and not have a fairly easy way to access either or both, when needed? -
Wednesday, June 01, 2011 7:45 PMI guess something is not clear to us - at least myself. May be if you re-phrase what you are trying to do (ex. what list fields and if any are lookups, where does teh drop down in InfoPath get its items from, what field has problem and how it is bound in InfoPath - or is a rule applied to it) .. etc. then sure someone can help.
AK -
Wednesday, June 01, 2011 8:01 PM
Library - - (InfoPath forms library)
DirectorName column
Division ColumnDirector List
Name
DivisionIn the form (entry form in library), my dropdown is populated from the Director List, with Division as the VALUE for the DropDown and the name is coming from the Director Name column (DISPLAY)
What I want to do is get what is displayed in the DropDown (not the VALUE) to populate the DirectorName column in the forms library - - instead, all that is promoted is the VALUE of the DropDown - - which is populated with the DIVISION
All I really need to do is have a dropdown with the names, and somehow populate columns in the Library with the DIRECTOR Name AND the DIVISION (which is based on the Director Name)
I've used other textboxes - I haven't been able to access both the VALUE and the DISPLAY NAME attributes of the DropDownList (in the properties dialog - DATA tab)
This has totally got me stumped - - I don't know how to word it any differently.
-
Thursday, June 02, 2011 1:25 AM
AugustWind, this definitely is easy. You still have to do what I said before, and you really have two options. First off, why are you using Division for the value if you don't need that value and only need the Director Name? If you simply set the Value to Director Name, then you will see DirectorName in SharePoint. Is there a reason you set the Value to Division if you expected and wanted to end up with Director Name? What is the reasoning for this?
If you DID need to get the Division value, then why did you expect to see DirectorName? Our assumption has to be that you promoted the field bound to the dropdown and named it Director Name when promoting it, right? You haven't given those details, but that's my best guess based off what you said. If you did this and intended that field to be promoted to SharePoint as the Director Name, then again, why would you set the value of the dropdown to Division? That doesn't make sense to me.
Anyway, this is what I normally do:
- Set the dropdown value to Division and Display Name to DirectorName (same as you)
- Promote the dropdown field and name it Division (because it stores the Division value, not Director Name)
- Create a rule on the dropdown with these settings
- Set a Field's Value
- Field = DirectorName field in the main data source of the InfoPath form template
- Value = DirectorName[Division=@Division]. What this means is that you are retrieving the DirectorName value OF THE SECONDARY DATA CONNECTION where the Division node OF THE SECONDARY DATA CONNECTION is equal to the dropdown field in the form (this stores the selected Division value
- What this does is iterate through the rows of the secondary data connection until it finds the row of data that contains the Division value selected in the dropdown, then reaches over to the DirectorName field, and places that value into the DirectorName field of your InfoPath form
This is pretty much a required thing to know how to do if you're using InfoPath professionally.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force- Marked As Answer by Lily Wu Thursday, June 09, 2011 9:26 AM
-
Thursday, June 02, 2011 1:36 PM
OK, I'll try this again - I want to display the Director Name in the Dropdownlist, but when the dropdownlist is changed, each director name corresponds to a particular division - that division needs to change and display in a textbox when the Director name is chosen - -
I'll look at the rest in a bit.
I came from an HTML/ASP/ASP.net world - - in that world, you have the display value and the actual (not visible) value. You can use either or both.Since InfoPath allows you to populate both separately, why aren't you allowed to use them both?
-
Thursday, June 02, 2011 2:15 PM
OK, I'll try this again - I want to display the Director Name in the Dropdownlist, but when the dropdownlist is changed, each director name corresponds to a particular division - that division needs to change and display in a textbox when the Director name is chosen - -
I'll look at the rest in a bit.
If that's what you want to do, then why is the dropdown value set to Division? You would then set its value to Director Name so that the field bound to the dropdown promotes as the real Director Name, and then use the steps I gave above to PUSH the Division value into your other text field. Why did you have the other Division field if you were already setting the dropdown field's value to Division? That's duplicative and omits your Director Name from the form's XML.IT's all the same either way - same concept.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force -
Thursday, June 02, 2011 5:53 PM
... then why is the dropdown value set to Division? ...
again, I come from the web programming side of things originally - asp/asp.net - - with a dropdownlist, you have the value and the display item - with those technologies, the two items are easily accessible. With a DropDownList in ASp.Net - you have SelectedItem.Value and SelectedItem.Text - - very straightforward....I guess it was silly of me to think that InfoPath could have the same basic technology, but because it was a MS product, I thought it did.
-
Thursday, June 02, 2011 6:02 PMYeah, whatever - it's still very easy.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force -
Tuesday, May 01, 2012 2:49 PM
Hi,
Will this only work if you are using a secondary data source - can it be done if the drop down were populated manually with a list of values and display names? The scenario is status codes and descriptions. The button rules can use logic like less than 30. Want to create text field to display the status display name and send to view.

