Show selected display name from dropdown in another field - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Show selected display name from dropdown in another field

Last post 10-08-2012 01:40 PM by Graeme. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-04-2012 12:38 PM

    Show selected display name from dropdown in another field

    ...but I don't want this other field to be part of the main datasource, which I think means I need to use a calculated field.  I tried that with this formula:

    xdXDocument:GetDOM("GetFormsList")/dfs:myFields/dfs:dataFields/tns:GetFormsListResponse/tns:GetFormsListResult/tns:Item/tns:DisplayName[../tns:Value = current()]

    but that doesn't work. What am I not understanding here?

  • 10-04-2012 03:32 PM In reply to

    Re: Show selected display name from dropdown in another field

    Hi -

    Well, I think what you may not be understanding is current(). Where is your calculated value located? Is it in a section bound to the same field that is bound to the dropdown? I'm thinking probably not... so I'd expect something perhaps more like:

    xdXDocument:GetDOM("GetFormsList")/dfs:myFields/dfs:dataFields/tns:GetFormsListResponse/tns:GetFormsListResult/tns:Item/tns:DisplayName[../tns:Value = current()/my:FieldThatIsBoundToTheDropDown]

    If you need to figure out where you are, you can always try just the local-name function in your calculated value - that will tell you, so you will then know what current() means in your particular instance. Does that make sense?

    (PS - I did a webinar on this recently - you can find a recording here.)

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 10-08-2012 01:40 PM In reply to

    Re: Show selected display name from dropdown in another field

    Looks like I don't understand current() at all. I changed the calculated value to use the xml data source to which the drop down is bound:

     xdXDocument:GetDOM("GetFormsList")/dfs:myFields/dfs:dataFields/tns:GetFormsListResponse/tns:GetFormsListResult/tns:Item[tns:Value = xdXDocument:GetDOM("SelectedId")/SelectedId/Id]/tns:DisplayName

     Hope to watch all the webinars soon.

    Thanks for your help.

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