4 Replies Latest reply on Jun 25, 2015 7:57 AM by AndrewJudd

    Popover Filtering Question

    AndrewJudd

      Title

      Popover Filtering Question

      Post

      Hi all, I have a question about popover filtering.

      I have a popover in my inventory layout which pops over to show my contacts table. This allows me to quickly assign a new inventory item to someone in my contacts table.

      As part of this popver I also have a search tool at the top to quickly search for the contact if they don't appear in the first portal sort records.

      To do this I use the below -

      If ( IsEmpty ( ARTWORK::Search) ; 1 ; PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search) > 0 )

      What I would also like to do is add the filter -

      CLIENTS 2 | POPOVER::Contact Type = "Artist"

      This would allow a user to see only the contacts given the contact type "artist" in the popover which would make life easier I think.

      How do I add this filter to the above? I have tried "&", "or" and "/" but they don't work and generally just make the popover blank.

      Thank you!

        • 1. Re: Popover Filtering Question
          philmodjunk

          Option 1:

          IsEmpty ( ARTWORK::Search) or
          CLIENTS 2 | POPOVER::Contact Type = "Artist" or
          PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search)

          Option 2:

          Case ( IsEmpty ( ARTWORK::Search) ; True ;
                     CLIENTS 2 | POPOVER::Contact Type = "Artist" ; True
                     PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search)
                    )

          Both should produce identical results. What you may want to think about is how that "contact type" field is intended to work for you. The above examples will show all contacts of type "artist" if artist is specified in the contact type field even if you then include text in the search field. (the search text will be ignored.)

          If you want to use the search text to filter all records of type "artist", use this expression:

          IsEmpty ( ARTWORK::Search) or
          ( CLIENTS 2 | POPOVER::Contact Type = "Artist" AND
          PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search) )

          Note the added parenthesis.

          More complex expressions are possible that allow "Artist" and an empty Search field to show all artists, yet allow the search field to also filter the list of artists when that type is specified.

          ( IsEmpty ( ARTWORK::Search) and IsEmpty ( CLIENTS 2 | POPOVER::Contact Type ) or  
          ( CLIENTS 2 | POPOVER::Contact Type = "Artist" AND IsEmpty ( ARTWORK::Search) ) or  
          ( CLIENTS 2 | POPOVER::Contact Type = "Artist" AND PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search) ) or
          ( PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search) and IsEmpty ( CLIENTS 2 | POPOVER::Contact Type )

          The first line shows all related records if both fields are empty. The second shows all related of type "artist" if artist is specified, but search is empty. The third shows all artists that match the search pattern and the last shows all contacts that match the search pattern when type is empty.

          Also note that in a Boolean expression like this, PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search) and PatternCount (CLIENTS 2 | POPOVER::Full Name ; ARTWORK::Search) > 0 produce identical results since any number result other than 0 will evaluate as True.

          Caulkins Consulting, Home of Adventures In FileMaking

          • 2. Re: Popover Filtering Question
            AndrewJudd

            Thanks so much, however, both trying top two options, I still have my complete list of contacts appearing rather than just the ones specified as "artist". Attached images to illustrate. thanks! 

            • 3. Re: Popover Filtering Question
              philmodjunk

              Yes, the first examples will show all contacts if the search field is empty.

              Try the last expression given.

              • 4. Re: Popover Filtering Question
                AndrewJudd

                amaze, thank you