4 Replies Latest reply on Jun 7, 2013 9:11 AM by philmodjunk

    Dynamic Portal filtering from multiple fields

    ChrisPye_1

      Title

      Dynamic Portal filtering from multiple fields

      Post

           Firstly, I promise I have googled this and found examples I dont understand.

           to simplify: I have one table with 4 fields; Name, Postcode, QueryName, QueryPostcode. I have made a self join relationship with Name and QueryName. On the layout I have a Portal listing all the Name & Postcode records from the new table2 as well as the Query fields. 

           If I enter text into theQueryName field, the table2::portal filters beautifully....

           How can I get the same to work for both the QueryName AND / OR the QueryPostcode field?

           Thanks for your time

        • 1. Re: Dynamic Portal filtering from multiple fields
          philmodjunk

               Presumably, you have this relationship:

               YourTable::QueryName = YourTable 2::Name

               Change it to:

               YourTable::QueryName X YourTable 2::Name AND
               YourTable::QueryPostCode X YourTable 2: Postcode

               Then, open portal set up and enter this filter expression:

               YourTable::QueryName = YourTable 2::Name OR
               YourTable::QueryPostCode = YourTable 2::Postcode

               and you'll be able to display records in the portal with matching name or postcode.

               Using the X operator and including both query fields in the portal's relationship ensures that the portal should update automatically when you select or enter values into either of the two query fields.

               This is a fairly simple filter expression to get you started. More sophisticated expressions--including some that can match by partial text entered into a query field are also possible.

               You may find this demo file's search portals of interest: https://www.dropbox.com/s/0pm1gdqcfi2ndpv/EnhancedValueSelection.fp7

          • 2. Re: Dynamic Portal filtering from multiple fields
            ChrisPye_1

                 Thank you Phil, You are the best. 

                 One tiny followup question:

                 I simplified my first question to find out the process which now makes my second question seem a little strange. If I dont enter any text into QueryName; I now get all the records which dont have a Name (this is correct and exactly what I would expect). Can I put in a 'If not empty' then use the data to filter statement? I tried, but it did not go well...

                 Thanks

            • 3. Re: Dynamic Portal filtering from multiple fields
              ChrisPye_1

                   I'm sorry, I walked away for a moment and found an answer. If anyone else needs to do this in the future then the Portal filter Calculation could be:

                    

                   If ( IsEmpty (  YourTable::QueryName) ; "" ;YourTable::QueryName X YourTable 2::Name ) 
                    
                    or
                    
                   If ( IsEmpty (  YourTable::QueryPostCode) ; "" ;YourTable::QueryPostCode = YourTable 2::Postcode )
              • 4. Re: Dynamic Portal filtering from multiple fields
                philmodjunk

                     I think that you meant to post:

                     If ( IsEmpty (  YourTable::QueryName) ; "" ;YourTable::QueryName = YourTable 2::Name ) 
                      
                      or
                      
                     If ( IsEmpty (  YourTable::QueryPostCode) ; "" ;YourTable::QueryPostCode = YourTable 2::Postcode )
                      
                wink