7 Replies Latest reply on Apr 23, 2014 8:47 AM by philmodjunk

    Filtering Similar To Excel

    sawmkw

      Title

      Filtering Similar To Excel

      Post

           I am new to FileMaker (two weeks) and have been able to do most of what I need to thus far.  I have a layout with one underlying table and would like to "filter" on the values in one of the columns in the way Excel does.  I have seen dozens of posts on portals and child tables but I simply want to give the user the ability to eliminate showing all records except a subset.  Can this be done?

        • 1. Re: Filtering Similar To Excel
          philmodjunk

               It can be done. in fact, there many different options.

               Here's the simplest method, but there are many other options that can also be used:

               Enter Find mode. Enter or select a value in the field for that column.

               Click Perform Find.

          • 2. Re: Filtering Similar To Excel
            sawmkw

                 I was pretty sure it was possible but would like to do it in a script.  I created the pop-up in the attached image and hoped to be able to put together a script that used the selected value from OnObjectExit and then update the layout.  Is this too messy?

                 Thanks for the quick response.

            • 3. Re: Filtering Similar To Excel
              philmodjunk

                   Then "but I simply want to give the user the ability to eliminate showing all records except a subset." was a tad vague don't you think?

                   If the field in the Popover is given global storage one of the scripts in the following thread can be adapted to perform the find. But I'd be inclined to add a "Find" button inside the popover that closed the popover and performed the find script. That just seems a bit more obvious to the user in terms of what they need to do. But OnObjectExit on the popover frame, not the button, should also work to perform such a script.

              Scripted Find Examples

              • 4. Re: Filtering Similar To Excel
                sawmkw

                     Okay, I can't seem to make this work and that is certainly due to my lack of experience.  My radio button set (PhaseRB) is displaying data from Project::Phase which is how it shows the current value in the button list.  The button list is created from a value list called "Phases".  What I want to accomplish is:

                     (1)  Allow the user to select a value different from what is displayed (default behavior of button list) (2) do not update the current field (not sure how to prevent this) (3) re-display the layout with only the records that match the selected value from the button list (PhaseRB).  I am not sure how to "get" the value of PhaseRB and then use it to re-display the layout. I did look at your examples but am not sure where the global variable would be created or used.  I'm still hoping to use the pop-up button display shown below

                • 5. Re: Filtering Similar To Excel
                  philmodjunk
                       

                            My radio button set (PhaseRB) is displaying data from Project::Phase

                       And did you specify global storage for this field?

                       What is the exact script that you created?

                       What script trigger did you select to run this script and for what object on your layout? (to simplify things until you are sure the rest of the system is working, I'd remove the script trigger and use a button to perform this script.)

                       To post a script to the forum:

                         
                  1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
                  2.      
                  3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
                  4.      
                  5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
                  6.      
                  7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
                  • 6. Re: Filtering Similar To Excel
                    sawmkw

                         Sounds like I need a globals table and leverage that with the OnObjectModify...

                    • 7. Re: Filtering Similar To Excel
                      philmodjunk

                           You don't have to use a Globals table, but it's not a bad idea. What makes a field "global" is to open field options in Manage | Database | Fields and select the "global" option from the Storage tab in the Field Options dialog. Since fields with global storage can be accessed from any layout, table or record in your database file, it's often very useful to put all such fields in a globals table as a way to more easily keep track of them (so long as they aren't used as a match field in a relationship), but this is not strictly necessary.

                           OnObjectModify is definitely one practical way to run this script if you set that trigger for the global field and it's formatted with radio button values or as a pop up menu.