How Can I Filter the Calendar?

Filters operate like a constraining find request, letting you see just a subset of the events in the calendar: those may be "your events", or events for a particular department, or those for a single customer. You can use the filters that come with the calendar, repurpose those, or create your own following the instructions below.

Filters are available on the Filters tab in the left hand status area. The main filters are "Statuses" though you can call them something else and change their contents easily (more on that here), and "Text" which is described here: text filters.

In addition to these status colors, DayBack ships with 3 "advanced" filters: title, project, and resources. To see how these works, click on Advanced Filters at the bottom of the filters tab in the calendar side bar.

Select one or more resources and then click "Apply and Close" and you'll see the calendar change to show just the items for those resources.

Now click "Omit" beside the filter and you'll see everything except events for the resources you've selected.

The title filter works the same way: type in "Call" and you'll see all the events where a work in the Summary begins with "Call". These filters work very much like the "constrain found set" find request you're already familiar with in FileMaker.

Modifying Filters

The rest of this article will discuss how you can modify the filters to suit your own use cases. Note that the Advanced Filters are shown in a new window on a FileMaker layout...not in the webviewer. This means you can manipulate this filters layout just as you would any other FileMaker layout: adding your own filters, reformatting check boxes, etc.

You'll find that layout in the Calendar Developer layouts folder. The layout is named "Filters".

(Modifying the status filters is done by manipulating the field mapped to "status" and then renaming / recoloring the filters themselves. Instructions here: Event Colors.)

Filtering on Different Fields & Different Sources

You can point the existing filters at any fields in your events table that you'd like. Mapping filters to fields is done in the "Load Calendar Settings - On Startup..." script you edited as part of your integration.

If you're using multiple sources you can map the same filter to a different field in each of your source tables. For example, our "title" filter may be mapped to the Summary field in your events table (that is, it searches for an event summary containing the text entered in the title filter) and mapped to the Procedure field in your surgeries table.

To do this (to map a filter to more than one field) separate the mapped fields with carriage returns like we've done in our sample integration for filters 1 and 2. (Note that you can only map a filter to one field from each table.) Be sure that each filter has an entry for every source. So if you have four calendar souces, each filter will need four fields mapped to it: if a filter doesn't make sense for a particular source, just map it to a new blank field.

More Details

A generic filter like "Event Title" may need to be mapped to a different field in each source's events table, so we let you map a return delimited list of field names (ideally GetFieldName()s) to each filter. When filtering we then execute on the first mapped field from the same table occurrence as the source in question.
This means we can only filter fields local to the source TO, but that is probably a good thing.
If no mapped fields match the source's TO we treat the filter as excluding that source. So a source of "Company meetings" might have a filter for "mandatory". That doesn't make sense in any other context. If you're then showing meetings along side your Birthdays source and you filter to see everything "mandatory", we'll hide all Birthdays since none are mandatory.

Can I add new filters?

Sure. Let's say you wanted to add a filter called "Staff" so you could see just the events for one or more staff members (for just you, or for the members of your team). Here's how you'd do it...

1. Create a staff name field in the events table.
If you don't already have a field in your events table for the staff member's name, create one. For the sake of this example we'll use the staff member's name as the filter, but you could use their ID, etc.
2. Create a value list for staff names. Then create a global text field in the CalendarInterface table called FilterGlob_5
3. Enter layout mode and navigate to the Filters layout in the Calendar Developer folder.
4. Duplicate (copy and paste) one of the existing filter fields (don't use the resource filter, it's special) on the "Filters" layout and then switch this field to be FilterGlob_5. Format this field to use the value list you created in 2 above; format it as checkboxes if you'd like to support multiple selections.
5. Still editing the Filters tab of the Calendar layout, duplicate the "clear" button and "omit" switch, placing them next to your new filter and change the script's script parameters for both to use the "number" of the field ("5" in our example). Edit the conditional formatting for both of these to use the new filter number ("5" in our example). If you're not sure how to edit those fancy switches, you can learn how here.
6. Finally, edit the script "Load Calendar Settings - On Startup..." and find the comment "Maps filters to fields". Create a new SetVariable line for your new filter ($$sc_FilterField5 in our example) and, using your new field for the GetFieldName ( SampleEvents::StaffName) in our example.
8. Edit the script "Clear All Filters" and add additional SetField and SetVariable steps for your new filter fields.
9. Enter browse mode and run the Upon Opening script again. That's it!

Can I pre-filter the calendar so it starts up already filtered?

Yes, and this can be a great way to speed up the calendar if you have tons of events, but many are already "complete" or irrelevant.

Toward the end of the configuration script "Load Calendar Settings - On Startup --- Edit Configuration Here ---" you'll see a comment called "Pre-Filter the calendar if necessary". The next lines set the four default filters that come with our calendar. The lines are currently disabled: enable any of them if you have FileMaker Advanced, or recreate the lines you need if you don't.

Hard coded filters

You can also add a hard-coded filter behind the scenes that users can't change. Learn more in the "Using Filters" section here.

Changing the Resource Filters

If you have large numbers of resources, the simple checkboxes used by default may not work for you. You'll find tips for modifying this to accommodate more resources, and resource categories, here: resources.

Keeping the Advanced Filters window open.

The button on the Advanced Filters window says "Apply and Close". If you'd like to apply the filter and keep the Advanced Filters window open, you need to make a couple changes.

1. Edit the script "Filters From Webvier" and change the last line of the parameter employed to #("sc_Style" ; "") That will give us a window we can keep open while manually switching over to the calendar window when we need to.
2. Edit the script "Apply Filters from Webviewer" and add the four lines highlighted in the screenshot below.
3. Navigate to the Filters layout and edit the "Apply and Close" button. Rename it to "Apply" =) and then edit the button's script so that the parameter passed is now #("sc_Close" ; 0)

That's it! =)

[email protected]
Follow us: