Ask a questionAsk a question
 

QuestionDropdown list filter out the data inside the sharepoint list

  • Tuesday, November 03, 2009 2:48 AMlxsg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I have a drop down list which the value is the from the database. the value is database column "Name" .
    And Now I want to add a filter of this dropdown list, to filter out all the data inside this column which exists inside a sharepoint list column "Name".
    That means only show those name which doest not exist inside the sharepoint list.

    e.g:

    Name in database list:

    AA
    BB
    CC

    Name in sharepont list:

    AA

    Name in infopath drop down list should be:

    BB
    CC

    Anyone can help with this? Thanks a lot.



All Replies

  • Tuesday, November 03, 2009 3:26 AMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    • Create a receive data connection for both.
    • Create a text field in your main data source.
    • Drag it to the canvas and change to a dropdown
    • Connect the dropdown to the external data source coming from your DB data connection
    • In the Entity field, choose the repeating group for your DB table, then click filter
    • Here, in the left pulldown, select the Name node of your DB data connection
    • For the operand, select "is not equal to"
    • In the last pulldown, select the sharepoint data connection.  Single-click the Name node and choose "Any occurrence of Name"

    Now, this is off the top of my head, so you may have to play with the combinations, but you may only be able to get the "Any occurrence of Name" pulldown on the left side of the equation.  Basically, you're trying to say..."Show me all results of Name here where they are not equal to any of the versions of Name over there."


    SharePoint Architect || My Blog
  • Tuesday, November 03, 2009 3:48 AMlxsg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Single-click the Name node and choose "Any occurrence of Name"


    Sorry, can you explain to me how can I choose "Any occurrence of Name"? Is it in drop down list filter Data or somewhere?
  • Tuesday, November 03, 2009 4:18 AMLauraRogers Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Here's how I do it in InfoPath:
    Create a sharepoint list that has all of the proper associations, using states/cities as examples:

    State          City
    Louisiana     New Orleans
    Louisiana     Baton Rouge
    Florida         Orlando
    Florida         Tampa

    Then, create a data connection in InfoPath to receive data from this list, and make sure you select both of the pertinent columns.
    Create a drop-down box that uses the new data connection, and the list of states.  Check the box to show only entries with unique display names.
    In a second drop-down box, use the same data source, and pick the city as the value.  On the screen where you pick the field from the data source, use the Filter button.
    This will allow you to filter the values based on the selection in the previous drop-down box.
    Laura Rogers, MCSE, MCTS
    SharePoint911
    http://www.sharepoint911.com/blogs/laura
  • Tuesday, November 03, 2009 4:35 AMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Laura, in this case, he's comparing two lists of the SAME data from two separate data sources (SharePoint and SQL) and choosing to only show a subset of the entries that are not in both lists.  This is not the same as cascading dropdowns from what I understand.
    SharePoint Architect || My Blog
  • Tuesday, November 03, 2009 4:36 AMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Single-click the Name node and choose "Any occurrence of Name"


    Sorry, can you explain to me how can I choose "Any occurrence of Name"? Is it in drop down list filter Data or somewhere?

    Check Figure 8 from my blog post here:

    InfoPath – User Roles in Browser-Enabled Forms Using AD Groups

    It has a screenshot showing what I'm talking about...
    SharePoint Architect || My Blog
  • Tuesday, November 03, 2009 4:43 AMlxsg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you very much.
    We realized Infopath2007 which we are using doesn't have this feature.
    Any other walk around to solve the problem?
    Most appreciated.
  • Tuesday, November 03, 2009 4:44 AMLauraRogers Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Okay, well one way to do that would be to connect both data sources to MS-Access, and just create a query.  Use the "Find Unmatched Query Wizard"  ;-)
    Laura Rogers, MCSE, MCTS
    SharePoint911
    http://www.sharepoint911.com/blogs/laura
  • Tuesday, November 03, 2009 4:51 AMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you very much.
    We realized Infopath2007 which we are using doesn't have this feature.
    Any other walk around to solve the problem?
    Most appreciated.

    What do you mean?  My blog picture shows InfoPath 2007.  Did you mean to say you ARE NOT using InfoPath 2007?  Are you using 2003?
    SharePoint Architect || My Blog
  • Tuesday, November 03, 2009 5:49 AMlxsg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you. I already found out the "Any occurrency of". We are using Infopath 2007.
    It seems still not working. The data existe in sharepoint list always show in drop down list.
    Thanks a lot.
  • Tuesday, November 03, 2009 5:52 AMlxsg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks Laura, Thank you for your reply. I may need to try some other ways :)
  • Tuesday, November 03, 2009 6:38 AMClayton Cobb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Yeah, I went and made a sample form, but it just won't let us compare many to many - only one to many.
    SharePoint Architect || My Blog