1 2 Previous Next 26 Replies Latest reply on Mar 25, 2013 8:54 AM by philmodjunk

    Filtering a Portal in FM10



      Filtering a Portal in FM10



           I'm using FM10, and would like to filter a portal.  I know that there's definitely a way to do it in FM11, but was wondering if FM10 can do it as well.  If I can't simply filter it, is there an alternative method to only allowing one type of information to pop up in my portal?

           Currently I have four types of jobs that a student can be assigned to, but in this portal I only want one specific type of job to be listed.


        • 1. Re: Filtering a Portal in FM10

               We filtered portals long before FileMaker 11 added the new feature we call a filtered portal. Thus, you can't use the filter expressions that you can in Filemaker 11 and newer, but you can still establish a relationship that filters for a specific job type.

               Let's say that the type of job you want in the portal is called "mobility assistant" in a JobType field in the StudentJobs table and that you currently have this relationship:


               Students::__pkStudentID = StudentJobs::_fkStudentID

               (See the first post of this thread for an explanation of my notations: Common Forum Relationship and Field Notations Explained)

               If you define a calculation field in students, constMobilityAsst, to have this calculation:

               "mobility assistant"

               With "text" specified as the result type...

               Then you can modify that relationship to be:

               Students::__pkStudentID = StudentJobs::_fkStudentID AND
               Students::constMobilityAsst =StudentJobs::JobType

               And a portal to StudentJobs will now only list jobs that have "mobility assistant" in the job type field.

               Note 1: if you use a text field in place of constMobilityAsst in the above relationship, you can edit the text in this field in order to list any selected JobType that you care to see in the portal. A checkbox format on such a field can even enable you to select multiple job types and see all the selected types in the portal.

               Note 2: You may need to use a separate Tutorial: What are Table Occurrences? of StudentJobs so that you can set up this relationship, and still keep the original relationship to support other parts of your database.

          • 2. Re: Filtering a Portal in FM10

                 I'm still having a difficult time understanding how creating a calculation field helps, and where to put this calculation field.

                 I have a student table and a table for courses, students can have a bunch of different jobs related to the courses, but I only want students who have one of these jobs (called Preceptor) to appear in the portal on the course page.

            • 3. Re: Filtering a Portal in FM10

                   It sounds like you have three tables, Students, courses and Jobs.

                   How have you linked them in relationships?

                   What field in Jobs identifies that the job is "Preceptor"?

              • 4. Re: Filtering a Portal in FM10

                     Yes, I have three tables, Students, Courses, and Student interations (aka jobs)

                     Students is linked to jobs through a student ID, and jobs is linked to courses through a course ID.  In the table Jobs, there is a filed for student ID, courseID, and job type (as well as other unrelated stuff like the date assigned and notes).  In the field job type four different kinds of jobs can be entered in (preceptor, senior preceptor, P apply, and SP apply-- the second two are when a student applies for a job because this table also serves the funtion of recording all of a students interactions with our organization).  The student interactions (jobs) portal on the student table is great, because it shows me each instance a student has applied for a job with us, as well as the times they got the job.  As for the jobs portal on the courses page, I only want to see those who got the specific job of Preceptor, and I can't figure out how to filter out the others.

                • 5. Re: Filtering a Portal in FM10

                       You appear to have these relationships. I'm guessing that "interations" is a typo that should be: interactions

                       Students----<Student interactions>----Courses

                       Students::Student ID = Student interactions::Student ID
                       Courses::Course ID = Student interactions::Course ID

                       To get what you want:

                       Define constPreceptor in Courses as:


                       Select Text as the result type. Make sure that Student Interactions::Job Type is also defined as a field of type Text. (check it in Manage | Database | fields if you are not sure.)

                       Now add a new Tutorial: What are Table Occurrences? of Courses.

                       In Manage | Database | relationships, make a new table occurrence of Student interactions by clicking it and then clicking the duplicate button (2 green plus signs). You can double click the new occurrence box to get a dialog to appear where you can rename the new occurrence box to be Student interactions|Preceptor.

                       We have not duplicated a table. Instead, this is a new reference to the same table already present in your database.

                       Repeat the process to add a duplicate occurrence of Students named Students|Preceptor.

                       Add them to your relationships like this:

                       Student interactions>----Courses----Student interactions|Preceptor-----Students|Preceptor

                       Courses::Course ID = Student interactions::Course ID AND
                       Courses::constPreceptor = Student Interactions::Job Type

                       Student interactions|Preceptor::Student ID = Students|Preceptor::Student ID

                       The additional table occurrences enable you to define new relationships to these two tables without it affecting your existing relationships for those two tables. Now you can add fields from Students|Preceptor to your courses layout to show the name of the student (and any other relevant data from the student table) that was selected to work as Preceptor for that course. If multiple students can work as preceptor for a given course, use a portal to Students|Preceptor to display them.

                       For an explanation of the notation that I am using here, see the first post of this thread: Common Forum Relationship and Field Notations Explained

                  • 6. Re: Filtering a Portal in FM10

                         I have attached an image of the relationships, it's still not wanting to display only the preceptor job.  I checked to make sure everything was worded correctly in my fields/ set as a result type as text.  I created a portal from the Student|Preceptor table to display both the students eid (ID) and name, but the portal either shows all four names I have recorded in student interactions or none of them regardless of the job I have assigned to the students name.

                    • 7. Re: Filtering a Portal in FM10

                           If the layout shows "course" or "course 2" in layout setup, your relationships do not match what I have suggested.

                           SI|Preceptor must link to the table occurrence specified in "Show Records From" of Layout Setup... for your Course layout.

                      • 8. Re: Filtering a Portal in FM10

                             The layout did in fact show course, so I changed it to Course|Preceptor, but now it won't show all of the courses I have in the program.  It's just showing empty records.

                        • 9. Re: Filtering a Portal in FM10

                               Instead of changing layout setup to refer to Course|Preceptor--which would force you to update a lot of field objects and other stuff on that layout, connect SI|Preceptor to Course and delete the Course|Preceptor table occurrence as you do not need it.

                          • 10. Re: Filtering a Portal in FM10

                                 Two problems now: 

                                 1. When I enter in a new student interaction, instead of adding the preceptor to the portal in the record already existing for their class, it creates a new record for the class with only that name in the portal.

                                 2. When I enter in a new student interaction that isn't assigning someone as a preceptor (ie giving them another job) the program creates a a blank record with the students name in the portal.


                            • 11. Re: Filtering a Portal in FM10

                                   You'll need to describe both 1 and 2 in more detail. Off hand it sounds like you are either using the wrong layout or that your layout is based on the wrong table occurrence so that "new record" is creating a new record in the wrong table or that you are entering data in a portal to the wrong table.

                                   Please describe your layouts, any portals that your are using, the names found in "Show Records From" and "Show Related Records From" in Layout and portal setup... and the exact steps you are using to "enter in a new student interaction".

                              • 12. Re: Filtering a Portal in FM10

                                     I have attached an image showing how my relationships are currently set up.  

                                     I have a layout used to enter in "student interactions" (which shows records from student interactions) interactions include getting hired for a job or applying for a job.  On each record I enter in the students information, the class related to their job, and then the "job type" which can essentially be one of four things (preceptor apply, preceptor, SP apply, and SP-- although there are a few more job types).  

                                     Then I have a course information layout that shows records from SI|preceptor.  This has class information at the top and then a portal which I would like to have only filtering for the job assignment of preceptor.  The portal shows the IDnumber (eid) and fullname of students from the table student|interactions.

                                • 13. Re: Filtering a Portal in FM10

                                       This is still  missing:


                                            and the exact steps you are using to "enter in a new student interaction".

                                       I need to know exactly how your are doing this step by step, starting from the layout (Presumably one based on student interaction) and then exactly what you do menu option by menu option, field by field.

                                  • 14. Re: Filtering a Portal in FM10

                                         When entering in a new student interaction go to a layout I have set up to hold records of interactions between the organization and students and I enter in the name of the student, their eid, the courses ID, and the interaction name (ie job type), there is also a field for notes and a date (type code is a calculation that gives me a number for each job type-- ie preceptor assign is coded as a 2, preceptor apply is coded as a 1).

                                         The second attached image is of the course information layout (which shows records from SI|preceptor), where I enter into each field information regarding a specific course, and then have a constant, which is a calculation that fills the field with the text "Preceptor Assign".  The relationship looks like:

                                    Courses::filter = Student Interactions::type

                                    which is what I was told to do in order to filer the portal at the bottom of the layout.  This portal shows the related records from Student|Preceptor eid and students fullname.

                                    1 2 Previous Next