Contains Filter on Form not working properly - InfoPath Dev
in

InfoPath Dev

Contains Filter on Form not working properly

Last post 01-09-2018 01:21 PM by TLFerrell. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 05-15-2013 07:54 AM

    Contains Filter on Form not working properly

    Hi. I am new to infopath and i have been searching for an answer to this question for a couple days and i might have missed something but haven't seen anything that is quite what i need. I have a field with a list of vendor names that retrieves data from a sharepoint list. However, some vendors have similar names, and people tend to just pick the first name they see, or they might not know the full name of the vendor. For instance we have two sepearate vendors, one is named 3M Cogent and the other is named Cogent Inc. Most people would just pick the Cogent one, not realizing they really mean 3M Cogent. To prevent this from happening i wanted to have to fields on my infopath form. One is a text box where they can type part of the vendor's name and then a list box (or combobox or anything that would achieve the same thing) below it would show all  the vendors that contain part of that data. Kind of like the "custom" filter options in excel and sharepoint list (when in dataview). However, when i use a contains filter condition and you type more than one letter it shows blank. I have tried building filters on Sharepoint but because our IT department isn't familar with Sharepoint but won't let anyone else have designer i can't do much with it because it is 2007 version. So, i am trying a work around. I thought it would be simple but it is not.

    I have tried dragging everything i could onto the form to see if i was putting the wrong values somewhere but nothing loks wrong. I am just hoping someone can help.

    Basic layout:

    Sharepoint list that has the following fields/: ID(auto generated) ; Vendor Name; VendorID; VendorNameAndID - The Vendor name and ID is text not a formula.

    Infopath has a VendorName and Vendor Name and ID field. Employee would type part of the vendor name in the text box, then the Vendor Name and ID field would populate with any information containing it.

    The infopath is connected to a SharePoint library where it will be stored.

    Any help or guidance would be greatly apprecaited.

      

  • 05-15-2013 12:00 PM In reply to

    Re: Contains Filter on Form not working properly

     I've attached a simple sample - save the file locally and open in design mode & preview to try it. Type a few letters in the text box and tab out - the hidden table has state names in it, to give you an idea of valid entries.

    I'm using the translate function in my conditional formatting, because XPath is case sensitive, so your filter could be failing because of that.

    Hilary Stoupa

  • 05-16-2013 12:03 PM In reply to

    Re: Contains Filter on Form not working properly

    Thank you. This was a huge help!

  • 11-08-2016 08:58 AM In reply to

    Re: Contains Filter on Form not working properly

     Hi,

    I had been using InfoPath many years ago and stopped as my client had Nintex, now I'm with a new client who is using InfoPath for now and I have come across an issue very similar to this.

    Same sort of setup except I'm using a choice filed in SharePoint that allows multiple selections, so I'm using Contains instead of Equals to filter the dropdown. Works perfectly in Preview mode. Guess what, when I publish this and view it in the browser, the filtered dropdown remains empty.

    Help please. Thinking this is a famous InfoPath browser form limitation, but there are no errors in the design checker, so it's clearly not by design. Has anyone else encountered this or got a workaround for this?

    Thanks 

  • 11-08-2016 09:01 AM In reply to

    Re: Contains Filter on Form not working properly

    Hmmm. I've not seen contains not work in browser specifically... I have seen data returned differently in browser than filler forms, however, in terms of casing, or decimal places. Is your contains comparison hard-coded or based on another selection?
    Hilary Stoupa

  • 11-09-2016 01:20 AM In reply to

    Re: Contains Filter on Form not working properly

     Hi Hilary,

    Thanks for your response.

    I have one dropdown called brand. The selection of this dropdown then filters the options available in my membershiptype dropdown. So it is cascading.

     

    This is it working fine in Preview

    This is it not working in Browser 

    When I click on the dropdown box I just get this thick black line around the control.

    A sample of my list data is below, as you can see the Brand column can have multiple selections and as such needs a "contains" operator.

     

    Here's the filter on my dropdown

    Brand (in my secondary data source) "Contains" Brand (from the form).

    This is IP 2013 

     

  • 11-09-2016 07:36 AM In reply to

    Re: Contains Filter on Form not working properly

    Your screenshots don't show for me. Can you paste them into a word doc or something and attach that under the options tab?
    Hilary Stoupa

  • 11-09-2016 08:13 AM In reply to

    Re: Contains Filter on Form not working properly

     Afraid I can't as I have had to move on from this for meeting deadlines.

    However the screenshots were of my preview mode where the Contains operator works fine, then my browser form where no options display in the dropdown.

    I then showed my SharePoint list which included the column the filter is applied against (a choice column that allows multiple selections) and lastly a screenshot of my filter which was simply showing the Contains operator for my secondary data source against my field on the form.

    The logic must be correct otherwise preview mode wouldn't work, however, one thing I noticed when trying to figure this out is when I look at the advanced data view of my secondary data source, the query field for my choice column is not available when it allows multiple selections, but it is when it's just set to single selections. InfoPath treats it as a repeating field when it can contain multiple selections. It doesn't explain why preview works and browser doesn't but it might have something to do with it.

    As an aside, I've come up with a fudge to get this working, by simply duplicating the Membership Types for each Brand. In this instance, it's not a big deal, but if you more options and more combinations that would be unworkable. 

  • 01-09-2018 01:21 PM In reply to

    Re: Contains Filter on Form not working properly

    I have run into ryangreenaway's exact issue and am looking for a solution. Anyone have any fresh info? 

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