So long as your drop-down is set up correctly (which it sounds like you have already done) to where the Value is 'code' and the Display Name is 'name', then you can set the 'code' from a rule from any view you want, and provided that it is a valid code, the correct name should appear in the drop-down list. This is assuming that your Data Source has already been populated via the Web service.
There shouldn't be any tricks to making the drop-down list display the right name. The only three things that should prevent this is:
1. Your drop-down list box isn't set up correctly (as described above).
2. You are setting a code that doesn't have a matching name defined in the data source.
3. Your data source has not yet been populated via the Web service.
--
Greg Collins [InfoPath MVP]
Please visit:
http://www.InfoPathDev.com
Thanks for the reply, but I think I described our setup poorly.
We have a webservice called GetStatesCode which returns an object that has a
code (the abbreviation) and the name (the longhand name of the state). Our
dropdown binding has GetStatesCode as the main lookup, code as the value, and
name as the displayed description (which I believe is what you're describing
below). The goal is to be able to have a rule from another view set the state
value to a code, but have the dropdown display the description which would
correlate to that code.
Thanks,
Bill
Greg Collins said:
Where are you binding your Value and Display Name to?
If you have a structure such as:
<State value="GA" name="Georgia">
You should your main lookup to "State" and not to "State/value"... you do this because then you can select "value" for the Value XPath and "name" for the Display Name XPath.
Chances are you see a dot "." in both the Value and Display Name fields... this is because you are binding to "State/value" instead of to "State".