Getting the displayname of the selectedvalue of a dropdown - InfoPath Dev
in

InfoPath Dev

Getting the displayname of the selectedvalue of a dropdown

Last post 10-16-2008 07:37 AM by BigMo. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-15-2008 01:22 PM

    • BigMo
    • Not Ranked
    • Joined on 10-14-2008
    • Posts 10

    Getting the displayname of the selectedvalue of a dropdown

    I have a dropdown in a infopath form. The items are comin from the DB via webservices. The dropdown is populated with a ID as a value and a NAME as the display name - no problem with that.  Now i want to set another field with the displayname of the selected value.  How can we achieve that?  If we use the xpathnavigator of the main data source / add rule to 'Set a field's value' with the selected value, it would set the ID (which is the value of the dropdown); not the display name.  Any help would be appreciated.

  • 10-15-2008 01:55 PM In reply to

    Re: Getting the displayname of the selectedvalue of a dropdown

    Hello & welcome!

    I would set the other field to the Name field from your secondary data source and then filter based on the ID being equal to the field in you Main DOM connected to the dropdown that is populated from that secondary data source. Does that make sense? Let me know if you need more detail...

    Hilary Stoupa

  • 10-15-2008 07:22 PM In reply to

    • BigMo
    • Not Ranked
    • Joined on 10-14-2008
    • Posts 10

    Re: Getting the displayname of the selectedvalue of a dropdown

    Can you please give me some more detail.  I am little confused. Thanks.

  • 10-15-2008 10:32 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Getting the displayname of the selectedvalue of a dropdown

    Hi,

     

    Enter following formula as text box (Another field) default value. Double click on the text box and enter below formula in the default value field.

     

    “Name[@id = field1]”

     

    Name – Display name from Secondary xml.

     

    ID – ID from Secondary Xml.

     

    Field1 – Dropdown.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 10-15-2008 10:37 PM In reply to

    Re: Getting the displayname of the selectedvalue of a dropdown

    Hi BigMo,Read the following link.http://www.infopathdev.com/blogs/matt/archive/2006/04/18/Automatically-Populate-Fields-from-a-Drop_2D00_Down-Selection.aspxIn the above link, they used the clients.xml as a secondary data source. You can use your data base secondary source.Hope this will help you.
    Swathip
    www.ggktech.com
  • 10-16-2008 07:37 AM In reply to

    • BigMo
    • Not Ranked
    • Joined on 10-14-2008
    • Posts 10

    Re: Getting the displayname of the selectedvalue of a dropdown

    Thanks Anuma & Swathip.  That worked.  When the user don't see the item which they are looking for, i have to give them the ability to add new items which create records in the DB & open up this same form with the newly added items.  I am thinking to have a button to add new items next to the dropdown and in the managed code of the button call a new IP form which adds the records to the DB, closes and refreshes this main form.  Any help on how to do that?

  • 10-16-2008 07:37 AM In reply to

    • BigMo
    • Not Ranked
    • Joined on 10-14-2008
    • Posts 10

    Re: Getting the displayname of the selectedvalue of a dropdown

    Or is there any other better approach to do the same?

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