Unique Values in Drop Down - InfoPath Dev
in

InfoPath Dev

Unique Values in Drop Down

Last post 08-22-2005 12:06 PM by crampto. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-19-2005 10:45 AM

    • crampto
    • Not Ranked
    • Joined on 08-19-2005
    • USA
    • Posts 3

    Unique Values in Drop Down

    I apologize if this is a redundant question. I've read several other posts on this subject, but I still can't quite find one that fits my scenario or make any of the solutions work for me.

    I have a drop down in my form which gets its values from a list on the sharepoint. The data is essentiall a flat data source with two columns; Category and Commodity. What I would like to implement is a cascading drop down so that the user chooses a Category and then the specific commodity for the category. My issue is, that I can't seem to get the Category drop down to show only unique values.

    I have a "receive" data connection to the list so that it is a secondary data source in the form.

    I go to the properties of the drop down box and select "Look up values in a data connection to a database, Web service, file, or SharePoint library or list.

    I select the data connection and click on the xpath next to entries.

    I expand the "dataFields" under myFields so that the List name and fields show.

    I've tried applying the filter at both the List Name level and at the specific field. Neither seems to work.

    I've tried using just "not(.=../preceding::my:group2/my:field2)" and a few other variations but either I still get the repeating values or I get nothing.

    I'd really appreciate some help on this as I am stumped.
  • 08-19-2005 11:09 AM In reply to

    Re: Unique Values in Drop Down

    It sounds like you are not working a repeating cascade. Have you read this how-to article:
    Create a Cascading List from a Flat Data Source
    http://www.infopathdev.com/howto/tutorials/default.aspx?i=4e038a7f3f5b443bbe4db49f86d95fba

    This walks you through exactly what you are trying to do.

    The filter you describe above will not work because you are using nodes from the main data source (i.e. my:group2, etc.) The filter needs to filter the secondary data source (SP list).

    You should be able to directly apply the filtering techniques in this how-to article to what you are trying to do.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 08-22-2005 12:06 PM In reply to

    • crampto
    • Not Ranked
    • Joined on 08-19-2005
    • USA
    • Posts 3

    Re: Unique Values in Drop Down

    Sorry for the confusion. I have read the article you suggested and have attempted to follow the instruction but I end up with the same result.

    I'm using a seconday data source which is called Commodities and provides the link to the Oasis_Commodities Sharepoint List which contains the columns Category and Commodity.

    I click on the on the x-path button next to Entries, expand Oasis_Commodities, and select Category.

    I then click on Filter Data and select Add.

    I change "Category" to "The expression" and enter:

    not(.=../preceding-sibling::Oasis_Commodities/@Category)

    and click OK four times to close all boxes.

    However, when I preview the form, I'm still seeing duplicate values.

    Thanks again for your help.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.