Filtering a drop-down list with conditions - InfoPath Dev
in

InfoPath Dev

Filtering a drop-down list with conditions

Last post 07-23-2015 06:55 AM by jawitthoft. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 07-22-2015 07:28 AM

    Filtering a drop-down list with conditions

     Hi - I have a drop-down field that gets the choices from an external data source and I am filtering the list based on the value of another field from the same list. The list contains values for Vendors and Contracts. A single vendor can have multiple Contracts but I want to display the active Contracts based on certain criteria and it's not working. I want to only show the Contracts that are not Deactivated and not Expired (these are two separate data points in the list). This conditions do not work when there is more than 1 Contract for the Vendor, I get all the Contracts in the drop-down. I've tried to use just one condition (e.g. not Deactivated) and still get the same results. I've tried changed the AND and OR operators and can't get it! Any ideas on what I'm doing wrong with the filter or conditions? It's probably something simple that I'm overlooking.

    See screenshot attached of the filters.

     


    Filed under:
  • 07-22-2015 07:47 AM In reply to

    Re: Filtering a drop-down list with conditions

     Can I see a copy of your form?

    Hilary Stoupa

  • 07-22-2015 07:56 AM In reply to

    Re: Filtering a drop-down list with conditions

     Sure! Attaching form. I wonder if you have seen this one before.

     Forgot to mention, the filtering I'm trying to do is on the FieldVendor control under the Field Contracts.

  • 07-22-2015 08:10 AM In reply to

    Re: Filtering a drop-down list with conditions

     Hahahahahah. I thought your user name looked familiar!

    As I was typing out suggestions for debugging, I think I realized what the issue may be. You could have, for example, three rows for this vendor. Maybe two contracts are expired, but one is active.... right? You want to show any vendor that has at least one active, non-expired contract?

     


    Hilary Stoupa

  • 07-22-2015 08:21 AM In reply to

    Re: Filtering a drop-down list with conditions

    LOL...I still can't get away from this one!  

    Yes, I want to show any vendor that has at least one active, non-expired contract and only show the corresponding Contract numbers for that vendor. What I'm experiencing is that when 1 contract is Deactivated and there is still one or more active, the drop-down is displaying ALL the contracts for that Vendor and not removing the ones that are Deactivated or Expired. Make sense?

  • 07-22-2015 08:31 AM In reply to

    Re: Filtering a drop-down list with conditions

     I'm confused, as usual. So - in the drop down for field vendor, where you have the filter for contract expired and deactivated, are you seeing the correct vendors? Because you then mention "the drop-down is displaying ALL the contracts" - but the drop down with the contracts is the Field Contracts, right? And the only filter on that is on vendor.... wouldn't you also need the filter for deactivated / contract expired on field contract as well?

    Hilary Stoupa

  • 07-22-2015 09:20 AM In reply to

    Re: Filtering a drop-down list with conditions

     That hadn't dawned on me but sounds very logical! Duh! I told you it would be something simple I was missing.

  • 07-22-2015 09:26 AM In reply to

    Re: Filtering a drop-down list with conditions

     As usual, I can't get it. I tried adding the filter to the Field Contracts and didn't get it right. See attached.

  • 07-22-2015 09:30 AM In reply to

    Re: Filtering a drop-down list with conditions

     What are the results you are getting with the filter you have added? Do any contracts show?

    Hilary Stoupa

  • 07-22-2015 10:59 AM In reply to

    Re: Filtering a drop-down list with conditions

     It's showing 1 Active Contract and 1 Deactivated Contract for the Vendor.

  • 07-22-2015 11:10 AM In reply to

    Re: Filtering a drop-down list with conditions

    Silly form. Drag the field contracts data fields onto the form and make sure the control for Deactivated is a text box so you can see the actual value and preview - is it really false? Or maybe blank and we need to use not equal to true?

    Hilary Stoupa

  • 07-22-2015 11:51 AM In reply to

    Re: Filtering a drop-down list with conditions

     I feel like I'm going in circles with this silly thing. So the Deactivated field is a check box. Cleared = false, Checked = true

    I tried some other combinations in the filter but no luck.

  • 07-22-2015 12:00 PM In reply to

    Re: Filtering a drop-down list with conditions

     Did you try changing that checkbox control to a text box like I suggested? So when you preview you can see the actual values?

    Hilary Stoupa

  • 07-22-2015 12:23 PM In reply to

    Re: Filtering a drop-down list with conditions

     Sorry, I missed that suggestion. The Deactivated field is coming from a SP list so I'll have to update it there with a Text box. I'll let you know how it goes. Thanks!

  • 07-22-2015 12:28 PM In reply to

    Re: Filtering a drop-down list with conditions

     I guess I'm not explaining well. Don't change your SharePoint list. Simply right click the Check Box in InfoPath and change to text. I'll post some screnshots in a minute.

    Hilary Stoupa

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