Populate a text box with Display Name from Drop Down List - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Populate a text box with Display Name from Drop Down List

Last post 09-08-2011 03:17 PM by SharpBud. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-02-2009 11:48 AM

    Populate a text box with Display Name from Drop Down List

    Hello,

    I have a drop down list w/ data pulled from a Sharepoint Contacts List.  I'm pulling the email address but displaying the full name.  I want to have the Display Name (full name) from my Drop down list populate a separate text box.  I want it to update continually as the user changes the drop down list choice.  I know there is a way to do this using rules/formulas but I don't know specifically how to set that up.  Can anyone help?

    Thanks,
    Aaron

  • 07-02-2009 02:14 PM In reply to

    Re: Populate a text box with Display Name from Drop Down List

    If you don't actually need the email address in the dropdown, then put Full Name in the Value field.  If you DO need that email address for other reasons, then set the default value of your other text field to this statement:

    Set Field's Value:

    NameField

    Contacts(Full Name) where (filter) Contacts(email_address) equals PulldownField.

    You're basically telling your text field to default to the Full Name of the person in the contacts list where the email address in the contacts list equals the email address in the form (the one chosen in the pulldown).

  • 07-02-2009 03:16 PM In reply to

    Re: Populate a text box with Display Name from Drop Down List

    Thanks for your help, warrtalon.

    What you are saying makes sense to me but I must be inputing it wrong somehow.  I am setting the default value to the Namefield and contructing the formula the way you have stated but I am getting an error.  I insert Contacts (Full Name) then go to insert Contacts (email_address) and choose "Filter..", then make it = to the PulldownField.  Any idea what I am doing wrong?

    Thanks,
    Aaron

  • 07-02-2009 04:01 PM In reply to

    Re: Populate a text box with Display Name from Drop Down List

    Ok, do it like this:

    1. Create FullName data element in your main data source as a Text field
    2. Drag element to form canvas (creates text box)
    3. Double-click that box for it's properties
    4. In the Default Value area, click the fx button
    5. In the function builder, select "Insert field"
    6. On the data source screen, choose your SECONDARY data source that comes from the Contacts list
    7. Drill down and SINGLE-CLICK the FullName node (or whichever node you're using for full names)
    8. Click filter while FullName is highlighted
    9. In the first pulldown, select the Email_Address field from the secondary data source
    10. Set the operand to "is equal to"
    11. In the last field, select the data element from your main data source that is bound to your dropdown
  • 07-06-2009 03:24 PM In reply to

    Re: Populate a text box with Display Name from Drop Down List

    Thanks again.  Works great.

     Aaron

  • 09-08-2011 03:17 PM In reply to

    • SharpBud
    • Not Ranked
      Male
    • Joined on 09-08-2011
    • SharePoint Architect
    • Posts 1

    Re: Populate a text box with Display Name from Drop Down List

    I followed this post to successfully populate a field (NameField) with the Display Name from a drop-down list that populates another field (ValueField). The drop-down list values and display names are retrieved from a web service (getFieldValuesAndNames). Both these fields (ValueField and DisplayField) are columns in a repeating table. The default value has the checkbox "Refresh value when formula is recalculated" checked.

     The advanced XPath for the default value of NameField looks like this:

     xdXDocument:GetDOM("getFieldValuesAndNames")/dfs:myFields/dfs:dataFields/ns2:getFieldValuesAndNamesResponse/ns2:getFieldValuesAndNamesResult/q1:Values/q1:Names[../q1:Value= current()/../my:ValueField]

     My problem is that when I create another view (for instance, a read-only view) the value for NameField appears blank. The value for the ValueField shows up correctly. Any idea on how to display the value in a different view?

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