Setting the default value of a text box to be the "Display name" from a drop down list box - InfoPath Dev
in

InfoPath Dev

Setting the default value of a text box to be the "Display name" from a drop down list box

Last post 12-17-2010 09:44 AM by whizzconsult. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-04-2008 11:12 AM

    • Patrick
    • Top 500 Contributor
      Male
    • Joined on 11-04-2007
    • Texas
    • Posts 51

    Setting the default value of a text box to be the "Display name" from a drop down list box

     Hi,

    I have a situation in which I hope there's a simple solution...

    I have a few controls, 2 text boxes and 2 drop down list boxes.  The drop downs are receiving their entries from 2 SharePoint Lists and have different columns feeding the "Display name" and "Value" properties in each.

     

    DDL1: Linked to Secondary Data Source (DS2)

    DDL2: Linked to Secondary Data Source (DS3)

    Txt1: Linked to Main Data Source

    Txt2: Linked to Main Data Source

     

    I would like to use the concat() function to take the "Display name" entries from Txt1 and each list box and show the result in the Txt2.  When I do this, it shows me the "Value" from each drop down instead of the "Display name".

    This is an example of my formula:
    concat(Txt1, "x", DDL1, " @ ", DDL2)

     

    I am wondering how to show the "display name" of each text box instead of each value.  I assume this is done with XPath, but I'm still learning.

    Formula:

    concat(SOFST_CircuitQuantity_drop, "x", SOFST_CircuitType_drop, " @ ", SOFST_PortBandwidth_drop)
     

    "Edit XPath (advanced)"

    concat(../../../my:SOFST_Network_Tab_sec/my:SOFST_CircuitQuantity_drop, "x", ../../../my:SOFST_Network_Tab_sec/my:SOFST_CircuitType_drop, " @ ", ../../../my:SOFST_Network_Tab_sec/my:SOFST_PortBandwidth_drop)

     

    I am using IDs as the values for each drop down, which are in the form of numbers with dashes: # - # - # # - # # # 

    The output looks like this:

     3x3-7 @ 3-7-10-375

    The desired output would look like this:

    3xT1 @ 4.5 Mbps 

     

    I hope I gave enough information.  Any help is much appreciated, as always.  You guys are great!

    -Patrick
  • 06-05-2008 12:45 PM In reply to

    Re: Setting the default value of a text box to be the "Display name" from a drop down list box

    Hey Patrick.

    You would just need to backtrack.

    If you know the values then just use a filter to get the display field.

    concat(txt1, "x", display[value=ddl1], "@", display[value=ddl2])

    So you just need to reference your secondary SP lists and look up the display field value where the value fields = what was selected.

    Hope that helps.

  • 06-17-2008 10:16 AM In reply to

    • Patrick
    • Top 500 Contributor
      Male
    • Joined on 11-04-2007
    • Texas
    • Posts 51

    Re: Setting the default value of a text box to be the "Display name" from a drop down list box

     Hi Clay,

     Thanks for the response.  I was out of the country for a while, so I just got a chance to look at this. 

    The concat formula you replied with...do I type that when the "Edit XPath (advanced)" is checked? or does it not matter?

    I tried typing that in and here's what it looks like in the formula field:

    concat(SOFST_CircuitQuantity_drop, "x", display[value=SOFST_CircuitType_drop], " @ ", display[value=SOFST_PortBandwidth_drop])

    I'm getting this error:  "display/value" does not point to a valid location path of a field or group.

     

    Maybe I misunderstood what you meant me to try.  Any ideas? 

    Thanks
     

    -Patrick
  • 12-17-2010 09:44 AM In reply to

    Re: Setting the default value of a text box to be the "Display name" from a drop down list box

    Hi guys, I am getting the same error as Patrick mentioned above.  Has anyone figured out the correct way to access the display name as opposed to the value?

    Thanks

    Leland

    Filed under: ,
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.