How to auto select the top(1) item for a dropDownListBox - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to auto select the top(1) item for a dropDownListBox

Last post 01-16-2012 07:07 AM by Jo-Anne Alfafara. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-16-2012 05:30 AM

    How to auto select the top(1) item for a dropDownListBox

    I need to set a value on a dropDownListbox to the first list item.  This list box is retrieving items from a webservice. But always show up the blank item after the data retrieved. Any one knows how to auto-Select the top 1 item or remove that blank item from the lists?

    Thank you!
    Snow
    Filed under:
  • 01-16-2012 06:29 AM In reply to

    Re: How to auto select the top(1) item for a dropDownListBox

    Hi snow.snow,

    You can set the default value of the dropdown list box to the item in your secondary data connection. That will display the first item in the list. The formula should look something like:

    xdXDocument:GetDOM("TestList")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[1]/d:Title

    Where "TestList" is your secondary data connection and d:Title is the field used to display the items in the dropdown. While [1] is manually added in the formula.

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-16-2012 06:55 AM In reply to

    Re: How to auto select the top(1) item for a dropDownListBox

    Thank you Jo-anne,

    the dropdow list has filter in the Title, so the top one in the secondary data connection some time is not in the filtered data lists(the #1 in the secondary data is not in the dropDownListbox items)...

    Snow
  • 01-16-2012 07:02 AM In reply to

    Re: How to auto select the top(1) item for a dropDownListBox

    Thank you Jo-Anne,

    I got it. I add filter and select the top 1 title.

    xdXDocument:GetDOM("TestList")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[contains(../first_name, xdXDocument:get-DOM()/dd:FirstName)][1]

    :)

    Thanks

     

    Snow
  • 01-16-2012 07:07 AM In reply to

    Re: How to auto select the top(1) item for a dropDownListBox

    Glad it worked! =)

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.