Zulu - Filtering

From 360Works Product Documentation Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "=Overview= Using filtering you can have an individual FileMaker table show up as multiple calendars in iCal: or have only a subset of a table show up in iCal. Each calendar ...")
 
 
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
=Overview=
 
=Overview=
 +
Filtering lets you limit the records that are synced to a calendar based on search criteria, or a day range.  This will allow you to have multiple calendars that do not share events.  A good example of this is having a calendar for each employee, and each employee's calendars only show the events that belong to them.
  
Using filtering you can have an individual FileMaker table show up as multiple calendars in iCal: or have only a subset of a table show up in iCal.
+
Each calendar in your calendar application is represented by a record in the ZuluCalendarList table. To see more about how the calendar records work, see: [[Zulu - Calendars And Publishing]]
 
+
Each calendar in your calendar application is represented by a record in the ZuluCalendarList table. By adding a value to the zulu_filterKey and zulu_filterValue fields in this table, you can have that calendar find just a subset of FileMaker records to display.
+
  
 
=Filtering By Value=
 
=Filtering By Value=
Line 13: Line 12:
 
* Search the "Status" field for the value "Urgent"
 
* Search the "Status" field for the value "Urgent"
  
The resultant found set are the events that Zulu will sync for this calendar.  Also, events that are created in calendar application will be inserted into FileMaker with the appropriate filterKey and filterValue values.
+
The resultant found set are the events that Zulu will sync for this calendar.   
  
 +
==Notes==
 +
* Events that are created in a calendar application will be inserted into FileMaker with the appropriate filterKey and filterValue values.  For example, if this calendar were configured with Apple Calendar, and a user inserted an event into this Apple Calendar calendar, it would be inserted into FileMaker with "Urgent" in the "Status" field.
 +
* When specifying a field in the zulu_filterKey field, you do not need to include the table name, just the name of the field on the events layout.
 +
* If the events are not showing on your calendar, double check that the field targeted by zulu_filterKey has same value as zulu_filterValue.  A lot of times when events don't show up on a calendar, its because the filter field does not have a value in it, or has the wrong value.
 +
* If you are using a list of filter values in your filter field, to share events between multiple different calendar records, if the event is edited on one calendar, the event will have the other calendars' filter values removed from the filter field, and will then be viewable only on the calendar that edited it.  This behavior is caused by the fact that when Zulu inserts or updates an event in FileMaker, Zulu writes the filterValue for the calendar record to the filterKey field specified.  This behavior can be modified using the Zulu_PostEdit script.  See here for more details on the Zulu_PostEdit script and event hooks: [[Zulu - Event Hooks]]
  
===Adding a Filter to an Existing Calendar===
 
  
:1. Navigate to the ZuluCalendarList layout in your FileMaker file and find the calendar record you wish to filter. Enter a field name into zulu_filterKey (you do not need to include the table name, for example enter Status, not Events::Status). And enter a filter criteria into zulu_filterValue: for example you might enter "Urgent".
+
==Filtering Todos==
:2. Map this field (Status in our example) on the "Filtering" tab of your Field Mapping layout (the one where you have our Required 1 and Required 2 tabs). This field should not have an object name.
+
:2. You may also want to change the name of your calendar to reflect this filter. Edit the value in zulu_displayName, making it something like "Events - Urgent".
+
:3. That's it. The next time you refresh your calendar in iCal or on your phone you'll see just those events where the field "status" contains "Urgent".
+
  
Note: you don't have to re-publish if you're just adding new calendars. You only need to republish if you've changed field mappings.
+
Filtering Todos works the exact same way as filtering events.  Consider the following calendar record:
  
Remember that this is a "contains" search, so in our example above it will filter for events where the event's status contains "Urgent".
+
[[File:Filtering Todos.png|x350px]]
  
If you want to have a calendar for items where there is no status, enter a value for the filter field in zulu_filterKey, but enter "=" (without quotes) into zulu_filterValue.
 
  
===Creating Additional Filtered Calendars: Duplicating Calendars===
 
  
You can duplicate existing calendars by duplicating their ZuluCalendarList records and just changing their filter criteria. Just be aware of a couple things:
+
To get the todos that belong to this calendar, Zulu will do the following:
 +
* Go to the "ZuluSampleTodos" layout
 +
* Search the "TodoStatus" field for the value "Urgent"
  
:When you duplicate the ZuluCalendarList record make sure you make up a UUID for the new calendar: just type in anything, making sure it is unique.
 
  
:Be sure to change the values for zulu_filterKey, zulu_filterValue, and zulu_displayName for each calendar you create. You can change the colors too but it is often easier to change colors in iCal.
+
Since this calendar supports both events and todos, it will also filter the events.  To get the events that belong to this calendar, Zulu will do the following:
 +
* Go to the "ZuluSampleEvents" layout
 +
* Search the "EventStatus" field for the value "Urgent"
  
That's it. You'll see one new calendar for each record in ZuluCalendarList next time you refresh your calendar in iCal.
 
  
===Specify Which Users Can See Which Calendars===
 
  
By using record level access privileges, you can limit which calendars different users can see.  <br><br>
+
=Filtering By Day Range=
These methods use Filemaker logic to filter the calendars, so there are many ways to do this. <br><br>
+
Consider the following calendar record: <br/ >
To get started though, here are two that are easy to set up
+
[[File:ZuluCalendarFilterDayRange.png|x400px]]
 
+
====Give Each User Access to One Calendar====
+
 
+
In your ZuluCalendarList layout, make sure the zulu_filterValue matches the account name for that calendar.
+
 
+
 
+
 
+
[[File:ZuluFilterValueAccountName.png]]
+
 
+
 
+
 
+
Now, modify the record level access privileges so that when that account tries to access the database, it can only see the calendar record that matches it's account name.
+
 
+
Here we create a Zulu privilege set, and set it so it can only access records in ZuluCalendarList when zulu_filterValue = Get (AccountName)
+
 
+
 
+
 
+
[[File:ZuluPrivilegeSet.png]]
+
 
+
Remember to re-Publish your calendars when you make new ones!
+
 
+
 
+
====Give Each User Access to Multiple Calendars====
+
 
+
In your ZuluCalendarList layout, make sure the zulu_filterValue ''contains'' the account name for that calendar.
+
 
+
 
+
[[File:ZuluFilterValueAccountNameMultiple.png]]
+
 
+
 
+
Now, modify the record level access privileges so that when that account tries to access the database, it can only see the calendar records that ''contains'' it's account name.
+
 
+
Here we create a Zulu privilege set, and set it so it can only access records in ZuluCalendarList when PatternCount(zulu_filterValue ; Get (AccountName)) = 1
+
 
+
 
+
[[File:ZuluPrivilegeSetMultiple.png]]
+
 
+
 
+
Remember to re-Publish your calendars when you make new ones!
+
  
 +
To get the events that belong to this calendar, Zulu will do the following:
 +
* Go to the "ZuluSampleEvents" layout
 +
* Search for records that have a Start Date between 30 days in the past, and 60 days in the future.  This is a dynamic search criteria, and will advance the search values as the current date advances.
 +
** For example, if the current date was 1/30/2019, Zulu would search the Start Date field for "1/1/2019...3/31/2019".  On the next day, 1/31/2019, Zulu would change the search criteria to "1/2/2019...4/1/2019".  Records that started on 1/1/2019 would be deleted from your calendar application, and records that started on 4/1/2019 would be added.
  
===Switching an event from Calendar to Calendar in iCal===
+
The resultant found set are the events that Zulu will sync for this calendar.
  
Learn more about this in [[Zulu Switching Calendars|Switching Calendars]].
+
==Notes==
  
== Filtering on Different Fields. ==
+
* Day Range Filtering is a one way operation from FileMaker to your calendar application.  If you have year old events in your calendar application, then you apply this filter, the events will be removed from the calendar application.  However these events will persist in FileMaker.  Zulu never deletes records from FileMaker, but it will delete records from your calendar application.
 +
* If you are filtering todos by date range, they will be filtered by the creation timestamp of the record.
  
Note that you don't have to have all your calendars filtering on the same field. You could have several calendars filtering on Resource (the production studio in which an event is scheduled, for example). Then you could create an additional calendar filtering on "Status" showing you just the events that are marked "Rush".
+
=Filtering By Record Level Access Privileges=
 +
When you set up a sync configuration or add an account to Apple Calendar, you provide a FileMaker account in the process. Zulu will always use this FileMaker account when querying FileMaker for calendar and event records.  The benefit of this is that Zulu will obey the FileMaker Record Level Access Privileges. So you can filter the event records based on FileMaker privileges, and records the account does not have access to will not be pushed to the calendar application.
  
== Additional Calendars from Different FileMaker Tables. ==
+
You can see more about Record Level Access Privileges here: [https://fmhelp.filemaker.com/help/17/fmp/en/index.html#page/FMP_Help%2Frecord-access-privileges.html%23 FileMaker Record Level Access Privileges]
  
You can also publish more than one table in the same FileMaker file. This is pretty simple...
+
==Filtering Calendars By FileMaker Account==
 +
The easiest way to accomplish this, is to use Record Level Access Privileges on the the ZuluCalendarList table, so that a user can only see the calendar that belongs to them. This takes advantage of the order that events are fetched:
 +
* First, Zulu queries FileMaker for which calendars it should sync.
 +
* Then, it queries for the events that belong to each of the calendars returned.
  
1. Create a new blank layout based on the table you wish to publish. Name it whatever you'd like the calendar to be named in iCal, though you can change this later.<br>
+
If a calendar is not returned by the first calendar query, the calendar will not be synced, and its events will not be fetched.  You may have business logic that requires a more complex setup, but this example is the bare minimum that you need.
2. Follow the [[Zulu Integration|integration instructions]] from step 5. "Mapping Fields" onward. Ending with running the "Publish Calendar" script from the new layout you created.<br>
+
3. That's it. Now when you [[Zulu Refresh|refresh]] your calendar in iCal you'll see a new calendar based on your new table. (You might want to read some warnings here about switching events between calendars based on different tables: [[Zulu Switching Calendars|switching calendars]].)
+
  
== Additional Calendars from Different FileMaker Files ==
+
====Walkthrough====
 +
Here are the basic configuration details of this privilege set:
  
Rather than import the Zulu scripts and tables into separate files. Use a single file to hold the Zulu scripts and ZuluCalendarList table: then create new table occurrences in that file for each calendar you wish to publish from another file, following the directions for "Additional Calendars from Different FileMaker Tables" above.
+
* The privilege set will need custom privileges for records. Also, be sure that "Access via XML Web Publishing" is also checked while you are here<br/ >
 +
[[File:ZuluCalendarUserPrivilegeSet.png|450px]]
  
==Going further==
+
* Limited record "View" privileges are needed for the ZuluCalendarList table:<br/ >
 +
[[File:ZuluCalendarUserRecordPrivileges.png|450px]]
  
Check out this [http://www.youtube.com/watch?v=jfgYnHzakvA video] demonstrating how you can use auto-enter calcs to preserve values that might otherwise be edited by filters. This technique can also be used to make parts of Zulu calendar records uneditable without throwing errors in iCal.
+
* Set the privilege calculation to:
 +
<pre>zulu_filterValue = Get(AccountName)</pre><br/ >
 +
[[File:ZuluCalendarUserViewPrivilegeCalc.png|450px]]

Latest revision as of 14:50, 19 August 2019

Contents

[edit] Overview

Filtering lets you limit the records that are synced to a calendar based on search criteria, or a day range. This will allow you to have multiple calendars that do not share events. A good example of this is having a calendar for each employee, and each employee's calendars only show the events that belong to them.

Each calendar in your calendar application is represented by a record in the ZuluCalendarList table. To see more about how the calendar records work, see: Zulu - Calendars And Publishing

[edit] Filtering By Value

Consider the following calendar record:
ZuluCalendarFilteringExample.png

To get the events that belong to this calendar, Zulu will do the following:

  • Go to the "ZuluSampleEvents" layout
  • Search the "Status" field for the value "Urgent"

The resultant found set are the events that Zulu will sync for this calendar.

[edit] Notes

  • Events that are created in a calendar application will be inserted into FileMaker with the appropriate filterKey and filterValue values. For example, if this calendar were configured with Apple Calendar, and a user inserted an event into this Apple Calendar calendar, it would be inserted into FileMaker with "Urgent" in the "Status" field.
  • When specifying a field in the zulu_filterKey field, you do not need to include the table name, just the name of the field on the events layout.
  • If the events are not showing on your calendar, double check that the field targeted by zulu_filterKey has same value as zulu_filterValue. A lot of times when events don't show up on a calendar, its because the filter field does not have a value in it, or has the wrong value.
  • If you are using a list of filter values in your filter field, to share events between multiple different calendar records, if the event is edited on one calendar, the event will have the other calendars' filter values removed from the filter field, and will then be viewable only on the calendar that edited it. This behavior is caused by the fact that when Zulu inserts or updates an event in FileMaker, Zulu writes the filterValue for the calendar record to the filterKey field specified. This behavior can be modified using the Zulu_PostEdit script. See here for more details on the Zulu_PostEdit script and event hooks: Zulu - Event Hooks


[edit] Filtering Todos

Filtering Todos works the exact same way as filtering events. Consider the following calendar record:

Filtering Todos.png


To get the todos that belong to this calendar, Zulu will do the following:

  • Go to the "ZuluSampleTodos" layout
  • Search the "TodoStatus" field for the value "Urgent"


Since this calendar supports both events and todos, it will also filter the events. To get the events that belong to this calendar, Zulu will do the following:

  • Go to the "ZuluSampleEvents" layout
  • Search the "EventStatus" field for the value "Urgent"


[edit] Filtering By Day Range

Consider the following calendar record:
ZuluCalendarFilterDayRange.png

To get the events that belong to this calendar, Zulu will do the following:

  • Go to the "ZuluSampleEvents" layout
  • Search for records that have a Start Date between 30 days in the past, and 60 days in the future. This is a dynamic search criteria, and will advance the search values as the current date advances.
    • For example, if the current date was 1/30/2019, Zulu would search the Start Date field for "1/1/2019...3/31/2019". On the next day, 1/31/2019, Zulu would change the search criteria to "1/2/2019...4/1/2019". Records that started on 1/1/2019 would be deleted from your calendar application, and records that started on 4/1/2019 would be added.

The resultant found set are the events that Zulu will sync for this calendar.

[edit] Notes

  • Day Range Filtering is a one way operation from FileMaker to your calendar application. If you have year old events in your calendar application, then you apply this filter, the events will be removed from the calendar application. However these events will persist in FileMaker. Zulu never deletes records from FileMaker, but it will delete records from your calendar application.
  • If you are filtering todos by date range, they will be filtered by the creation timestamp of the record.

[edit] Filtering By Record Level Access Privileges

When you set up a sync configuration or add an account to Apple Calendar, you provide a FileMaker account in the process. Zulu will always use this FileMaker account when querying FileMaker for calendar and event records. The benefit of this is that Zulu will obey the FileMaker Record Level Access Privileges. So you can filter the event records based on FileMaker privileges, and records the account does not have access to will not be pushed to the calendar application.

You can see more about Record Level Access Privileges here: FileMaker Record Level Access Privileges

[edit] Filtering Calendars By FileMaker Account

The easiest way to accomplish this, is to use Record Level Access Privileges on the the ZuluCalendarList table, so that a user can only see the calendar that belongs to them. This takes advantage of the order that events are fetched:

  • First, Zulu queries FileMaker for which calendars it should sync.
  • Then, it queries for the events that belong to each of the calendars returned.

If a calendar is not returned by the first calendar query, the calendar will not be synced, and its events will not be fetched. You may have business logic that requires a more complex setup, but this example is the bare minimum that you need.

[edit] Walkthrough

Here are the basic configuration details of this privilege set:

  • The privilege set will need custom privileges for records. Also, be sure that "Access via XML Web Publishing" is also checked while you are here

ZuluCalendarUserPrivilegeSet.png

  • Limited record "View" privileges are needed for the ZuluCalendarList table:

ZuluCalendarUserRecordPrivileges.png

  • Set the privilege calculation to:
zulu_filterValue = Get(AccountName)

ZuluCalendarUserViewPrivilegeCalc.png

Personal tools
Namespaces

Variants
Actions
Plug-in Products
Other Products
Navigation
Toolbox