Combobox - Filter only "new" items. - InfoPath Dev
in

InfoPath Dev

Combobox - Filter only "new" items.

Last post 11-19-2010 11:29 AM by Hilary Stoupa. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 11-10-2010 06:18 AM

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Combobox - Filter only "new" items.

    Hello,

    I have a form, which is a checklist basically with a combobox "AppName" with a datasource from a sharepoint list.  "AppName" is a list of applications to test, which is what each form is for (one form per app).  I want to filter the combo box to only show items which haven't been 'tested' already.  The form sumbits to another Sharepoint library. 

    Basically I want the combo box to only populate "AppName" if "AppName" doesn't exist in the Submit data connection Sharepoint Library.

    How do I go about this?

  • 11-16-2010 12:31 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Combobox - Filter only "new" items.

     No suggestions?  Or nobody understands what I mean?

  • 11-16-2010 12:45 PM In reply to

    Re: Combobox - Filter only "new" items.

    What does the current filter on your data source for your dropdown look like?
    Hilary Stoupa

  • 11-16-2010 01:29 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Combobox - Filter only "new" items.

     Hello,

    Well right now there is no filter.  It shows all items in a list on Sharepoint.

    The dropdown (AppName) has a datasource from Sharepoint called  (ACTExport), column (ApplicationVersion).

    Once the form is complete the data is submitted using a submit datasource called (Main Submit)

    That datasource has a column called (App_Name) which is the exact same as the (AppName) from the receive or Main datasource,

    I tried creating a filter where

    ApplicationVersion IS NOT EQUAL to App_Name

    but all the values still show up.

     

     

  • 11-17-2010 01:39 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Combobox - Filter only "new" items.

     What I find interesting is that I changed the filter so the drop-down only shows when both lists are EQUAL, and that actually works (it shows the items that match).  But I want to only show the items that are in the ApplicationVersion list that don't show in the AppName list.

  • 11-17-2010 02:53 PM In reply to

    Re: Combobox - Filter only "new" items.

    For your filter, can you change the first drop down to the selection "The expression" and then paste the XPath that is displayed in the second field in a reply?
    Hilary Stoupa

  • 11-17-2010 03:03 PM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Combobox - Filter only "new" items.

    Hello, this is the result...

    . != xdXDocument:GetDOM("Compatibility Checklist Results")/dfs:myFields/dfs:dataFields/dfs:Compatibility_Checklist_Results/@App_Name

  • 11-17-2010 03:11 PM In reply to

    Re: Combobox - Filter only "new" items.

    I'm wondering if you'll need to create the filter by hand. What is the XPath to the field that is the "." in the XPath above?
    Hilary Stoupa

  • 11-18-2010 06:08 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Combobox - Filter only "new" items.

     Hello,

    Thank you for the help again.  The Xpath of this field (AppName) is below.

    /dfs:myFields/dfs:dataFields/dfs:ACT_Export/@ApplicationVersion[. != xdXDocument:GetDOM("Compatibility Checklist Results")/dfs:myFields/dfs:dataFields/dfs:Compatibility_Checklist_Results/@App_Name]

  • 11-18-2010 02:21 PM In reply to

    Re: Combobox - Filter only "new" items.

    I'll let someone brighter than I am explain WHY this is, but what worked for me in a sample form was to first set my filter to use equals (as you noted, equals works, != does not). Then I selected "The expression" for my filter and wrapped it in a not().

    So your filter would look like:

    not(. = xdXDocument:GetDOM("Compatibility Checklist Results")/dfs:myFields/dfs:dataFields/dfs:Compatibility_Checklist_Results/@App_Name)

    I've attached my sample form as well.

    Hilary Stoupa

  • 11-19-2010 06:53 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Combobox - Filter only "new" items.

     Hi,

    That doesn't work for me either.  I tried this expression 

    not(. = xdXDocument:GetDOM("Compatibility Checklist Results")/dfs:myFields/dfs:dataFields/dfs:Compatibility_Checklist_Results/@App_Name)

     But it still shows ALL values instead of values that exist in ApplicationVersion but don't exist in App_Name.  Again, if I remove the "not" the filter works and provides only the items which exist in App_Name.

  • 11-19-2010 10:13 AM In reply to

    Re: Combobox - Filter only "new" items.

    Does the sample form I attached work for you?
    Hilary Stoupa

  • 11-19-2010 10:51 AM In reply to

    • Sailor
    • Top 75 Contributor
    • Joined on 09-15-2009
    • Canada
    • Posts 107

    Re: Combobox - Filter only "new" items.

    Yes, the sample does work.  It leaves out the Thing3 and Thing4 in the drop-down.

    EDIT - I think this problem is not the syntax of the filter.  It looks like the data source on the receive connection for "Compatibility Checklist Results" is not getting all the data.  I added a dropdown on the form to just view the data in this list and it does not include all the items that are in WSS. I checked the default "All Documents" list and made sure it is set to show 800 items, which is more than enough.  I wonder if it's because the default list is grouped.  This list currently has about 230 items.

  • 11-19-2010 11:29 AM In reply to

    Re: Combobox - Filter only "new" items.

    So, it may be easier to drag that secondary data connection onto your form (so you have a repeating table showing what's in it) to see how many items you have. Then, can you try ungrouping to see if you get all items back? I don't think grouping could cause this.... but SharePoint continually finds ways to surprise me.
    Hilary Stoupa

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