10 Replies Latest reply on May 12, 2010 5:01 AM by x94bp6ru6

    Conditional Filtering a portal

    x94bp6ru6

      Title

      Conditional Filtering a portal

      Post

      any easy way to search or filter portal rows?

       

      I've got a self-relationship portal that displays each records as a portal.

       

      Is there a way I can create a search box with a drop down menu next to it (for type)

       

      and I can choose filter by which field,  and after entered, only records in the type choosen has matching data will show up in the portal.

       

      sorry for my bad english..  Hope the following'll help a little on understanding my bad writing

       

      FieldA   FieldB    FieldC  

      1               q              cab

      2               e              cat

      2               sde           cat

       

      then in the dropdown menu , I can select to filter by fieldA with text "2"

      and only 2nd and 3rd row will show up in the portal

       

      if select filter by fieldC  and enter ca

      ony 1st and 3rd will show up

       

      select by fieldB, using text sde

      only 3rd will show up

       

       

      thanks in advance

        • 1. Re: Conditional Filtering a portal
          mrvodka

          What version are you using?

          • 2. Re: Conditional Filtering a portal
            x94bp6ru6

            Windows version (FM 10 Multi-Language)

             

            If this can only done by fm11, I can ask my boss to get fm11

            • 3. Re: Conditional Filtering a portal
              philmodjunk

              You can do this more easily in Filemaker 11 using a portal filtering expression, but you can still do it in Filemaker 10 and earlier.

               

              I'm only going to use the first and third "filter" fields in my example, you should be able to figure out how to expand the method to include field 2 on your own.

               

              The basic concept is to modify your portal's relationship to include your filtering fields.

               

              If your portal relationship currently looks like this:

               

              MainTable::SerialID = PortalTable::SerialID

               

              You'd modify it to be

              MainTable::SerialID = PortalTable::SerialID AND

              MainTable::cKey1 = PortalTable::cKey1 AND

              MainTable::cKey2 = PortalTable::cKey2

               

              The four cKey fields are calculation fields that produce the desired match values that make this work. You also need two fields, gField1, gField2  in MainTable, (almost always global fields), that you will format as your drop down fields for filtering the portal.

              Main Table cKey fields:

              cKey1 : If ( IsEmpty ( gField1 )  ; "*All*" ; gField1)

              cKey2 : If ( IsEmpty ( gField2 )  ; "*All*" ; gField2)

               

              Portal Table cKey fields:

              cKey1 : Field1 & "¶*All*"

              cKey2 : Left ( Field ; 1 ) & ¶ &

                            Left ( Field ; 2 ) & ¶ &

                            Left ( Field ; 3 ) & ¶ &

                            Left ( Field ; 4 ) & ¶ &

                           "*All*"

               

              Note: to match more than the first 4 letters, add more Left functions or use Filemaker Advanced to create a recursive function that genereates this match pattern for text of all lengths.

              • 4. Re: Conditional Filtering a portal
                x94bp6ru6

                I' sorry but I really don't get how to do it, I followed the steps but happen to be nothing's showing up in the portal anymore. Can you decribe the method a little bit detail please, thank you!  by the way, if i may, I uploaded a file that would explain everything I want to do. thank you for your help!

                 

                http://woodlai.myweb.hinet.net/portalsearch.fp7

                • 5. Re: Conditional Filtering a portal
                  x94bp6ru6

                  and I'm using a self relationship table with X operator, what should I do about the ckey filed?

                   

                   

                  also

                   

                  cKey1 : Field1 & "¶*All*"

                  cKey2 : Left ( Field ; 1 ) & ¶ &

                                Left ( Field ; 2 ) & ¶ &

                                Left ( Field ; 3 ) & ¶ &

                                Left ( Field ; 4 ) & ¶ &

                               "*All*"

                   

                   

                  what does the above mean, field1 and field mean the field name filtering?

                  • 6. Re: Conditional Filtering a portal
                    x94bp6ru6

                    i got it solved using the filter option

                     

                    IsEmpty ( a::gSearch ) or a::gSearch =Left ( alist::a ; 1 ) or a::gSearch = Left ( alist::a ; 2 )or a::gSearch =Left ( alist::a ; 3 ) or a::gSearch = Left ( alist::a ; 4 ) or a::gSearch =( alist::a)

                     

                    just wondering if there's anyway to make the code work better or smoother?  and one more, any chance having it filter like search?

                    which means i I can have  "cat" be listed while "at" entered in the search box

                     

                    thank you

                    • 7. Re: Conditional Filtering a portal
                      aammondd

                       I would think a calculation field using pattern count refering to the global search field could work self refer with calcvalue gte 1

                      • 8. Re: Conditional Filtering a portal
                        x94bp6ru6

                        omg why haven't I thought about this easy solution! thank you so so much

                        • 9. Re: Conditional Filtering a portal
                          aammondd

                          let me know if it works  I was just thinking out loud

                          • 10. Re: Conditional Filtering a portal
                            x94bp6ru6

                            it works perfectly! : )