get DisplayName value from a drop down list box - without data connection - InfoPath Dev
in

InfoPath Dev

get DisplayName value from a drop down list box - without data connection

Last post 09-28-2010 08:00 AM by blueeyedtxn. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-27-2010 03:34 PM

    get DisplayName value from a drop down list box - without data connection

    hi all,

    first i 'd like to say a big thank you to all of the great folks who consistently share their know-how on this site. it has saved me on countless occasions.

    i've spent all day trying to find an answer to my question and haven't been able to, so here goes:

     Infopath 2003 - i have a form with multiple sections some of which are hidden based upon user roles. in one section i have a drop down list box for the "status" of a project. the drop down list is 'hard coded' with values/display names (e.g. add'lInfo/Waiting Add'l Info or newSubmission/New Submission, etc.).

    the list box has to be ina section that is hidden from one of the user roles - 'general users' - however i need to place a text box in the form section that general users see that reflects the current value from the drop down list box. the general user sees "The current status is: textboxgoeshere".

     the problem i'm having is that i need the Display Name but i'm getting the value. (ex: i get add'lInfo when i need Waiting Add'l Info. i've seen many posts answering a similar problem but they are all using a data connection and filters to pull in the list box items. i'm not - as i said my values are hard coded in the list box properties.

    right now i have a rule applied to the drop down box that's set to "Set a field's value". for the Field i have statusText (the name of the text box i'm trying to populate) and in the Value i have "." (that's an underlined period) which i got by choosing the fx button and then selecting 'status' in the main data source. ('status' is the name for the drop down). i don't have any filter on there coz i couldn't figure out a combination that would work.

     can anyone help me fill the text box with the display name instead of the value?

     any help would be much appreciated.

    thanks,

    david

     

  • 09-27-2010 03:53 PM In reply to

    Re: get DisplayName value from a drop down list box - without data connection

    Hi -- I'm afraid you'll need a handful of rules with conditions for this, since your values are hardcoded into your form -- basically, if the value of the field the dropdown uses is 1 (for example), you'll set the textbox to the appropriate description ("New", for instance).

    May I suggest that instead of using hard coded values, you just use an XML file as a resource in your form and have all your displays and values in there? Then you could use a filter instead of having to have a bunch of rules and conditions. I think that would be a more maintainable solution going forward.

    The amazing Jimmy Rishe recently posted a reply with some info on this, take a look and see if it helps you.

    Hilary Stoupa

  • 09-28-2010 08:00 AM In reply to

    Re: get DisplayName value from a drop down list box - without data connection

    thanks so much for the informatioin, hilary. i knew someone would know.

     i'm actually using external xml to populate some cascading drop downs elsewhere in the form, so it should be easy to set this up. i just thought it made more sense to hardcode since it was a static set of values and a small number of items. obviously i was wrong ;-)

     thanks again!

    david

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.