Transformers¶
General¶
textchange¶
Changes the given text field.
- Specify the
fieldasTITLE,DESCRIPTIONorLOCATION. -
Specify
modeto set the operation to perform:OVERWRITE- Sets
fieldto the givenvalue. APPEND/PREPEND- Inserts the given
valueat the end or at the beginning of the existing value infield. If the field is empty, it is set to the given value. CLEAR- Clears the given
field. Do not specify avalue.
{
"type": "textchange",
"field": "TITLE",
"mode": "OVERWRITE",
"value": "Meeting"
}
{
"type": "textchange",
"field": "TITLE",
"mode": "APPEND",
"value": " [Corporate]"
}
{
"type": "textchange",
"field": "DESCRIPTION",
"mode": "CLEAR"
}
statuschange¶
Sets the event status.
- Specify a
valueof"FREE","TENTATIVE","BUSY","OUT_OF_OFFICE","WORKING_ELSEWHERE","UNKNOWN"ornull(without quotes).
{
"type": "statuschange",
"value": "FREE"
}
Compatibility note
Not all values are supported by all systems. For details, see the "Status" table.
visibilitychange¶
Sets the event visibility.
- Specify a
valueofNORMAL,PERSONAL,CONFIDENTIAL,PRIVATE,UNSPECIFIEDorPUBLIC.
{
"type": "visibilitychange",
"value": "PRIVATE"
}
Compatibility note
Not all values are supported by all systems. For details, see the "Visibility" table.
reminderset¶
Sets a reminder on the event. You can specify the reminder time in one of two ways:
- Lead time in minutes
-
Specify the number of
minutesbefore the event start. This works with all-day events and regular events.For example,
"minutes": 0schedules the reminder to when the event starts, whereas"minutes": 120sets it to two hours before that.
{
"type": "reminderset",
"minutes": 0
}
- Time of day
-
For all-day events, you can alternatively specify the time for the reminder with
atin 24-hour format, e.g."at": "17:00"for 5 o’clock in the afternoon.The day the reminder should occur is specified with
daysBefore. The day of the event is0, the previous day is1and so on. If not specified, the reminder is set on the same day.
{
"type": "reminderset",
"at": "09:00",
"daysBefore": 1
}
No same-day reminders with Google
When writing all-day events to Google, time-of-day reminders set for the same day ("daysBefore": 0) will be ignored. Google supports setting same-day reminders only in their own apps.
Number of reminders
Microsoft supports only one reminder, Google supports up to 5 reminders per event.
If you use more reminderset transformers than that, ChronoLink will apply only the last 5 (Google) or last one (Microsoft) from the transformer list.
Default reminders
Events created by ChronoLink do not have reminders by default. Your Google Calendar or Microsoft Outlook settings for default reminders cannot be applied.
For details, read the user guide page on Reminders.
Properties¶
Note
By default, a connection does not copy any properties from source events to target events. They must be copied or set explicitly using the transformers below.
propertycopy¶
If the source event has a property with the given key, copy it to the target event.
- Optionally, specify a different property key to use for the target event via
as.
{
"type": "propertycopy",
"key": "google:color.name"
}
propertyset¶
Sets the property given in key to the given value on the target event.
{
"type": "propertyset",
"key": "google:color.name",
"value": "blueberry"
}
Logical¶
chain¶
Applies a list of transformers in the given order.
{
"type": "chain",
"transformers": [
{
"type": "textchange",
"field": "TITLE",
"mode": "OVERWRITE",
"value": "[HR Calendar]"
},
{
"type": "textchange",
"field": "DESCRIPTION",
"mode": "OVERWRITE",
"value": "Details omitted."
},
{
"type": "textchange",
"field": "LOCATION",
"mode": "CLEAR"
}
]
}
if¶
If the given condition matches the event, the transformer given in then is applied, otherwise the one in else. The latter is optional.
{
"type": "if",
"condition": {
"type": "property",
"key": "clockodo:billable",
"is": "true"
},
"then": {
"type": "textchange",
"field": "TITLE",
"mode": "PREPEND",
"value": "💰"
},
"else": {
"type": "textchange",
"field": "TITLE",
"mode": "PREPEND",
"value": "🎁"
}
}
unless¶
Applies the transformer given in do only if the given condition does not match the event. If it does match and a transformer was given in otherwise (optional), that transformer is applied instead.
Using this transformer is equivalent to using if combined with the not condition. Its sole advantage is that for some scenarios, unless can be more compact, increasing the readability of the transformer configuration.
{
"type": "unless",
"condition": {
"type": "property",
"key": "google:color.name"
},
"do": {
"type": "textchange",
"field": "TITLE",
"mode": "OVERWRITE",
"value": "Busy"
}
}
switch¶
Checks several cases and applies the transformer of the first one whose condition matches the event.
-
The value of
casesmust be a list of blocks. Each such block specifies a condition viawhenand a corresponding transformer viathen. -
Optionally, you can specify
defaultto set a transformer that is applied if no case matches the event.
Note
Unlike conditions and transformers, a case block does not specify a type.
{
"type": "switch",
"cases": [
{
"when": {
"type": "property",
"key": "clockodo:customer.id",
"is": "1234567"
},
"then": {
"type": "propertyset",
"key": "google:color.name",
"value": "basil"
}
},
{
"when": {
"type": "property",
"key": "clockodo:project.id",
"is": "1200001"
},
"then": {
"type": "propertyset",
"key": "google:color.name",
"value": "banana"
}
}
],
"default": {
"type": "propertyset",
"key": "google:color.name",
"value": "peacock"
}
}
Advanced¶
include¶
Includes the event in the synchronization run.
Usage of this transformer allows synchronizing events with a response of PENDING or
DECLINED, which are excluded by default.
Warning
To avoid including undesired events, it is strongly recommended to use include only within an if (or switch) as shown here.
Also, keep in mind that unlike the original PENDING and DECLINED events, the synchronized copies will be normal events displayed without special styling. Therefore, consider adding more transformers to highlight them, as shown in the Copy pending invitations to your main account example.
[
{
"type": "if",
"condition": {
"type": "response",
"is": "PENDING"
},
"then": {
"type": "chain",
"transformers": [
{
"type": "include"
},
{
"type": "textchange",
"field": "TITLE",
"mode": "PREPEND",
"value": "❓ "
}
]
}
}
]
exclude¶
Excludes the event from the synchronization run.
Using the exclude transformer on an event has the same effect as filtering out that event with a suitable
condition.
If both include and exclude are used on the same event, the transformer that is processed last will take effect.
{
"type": "exclude"
}