Prefix Event Titles
What it does: Prepends a text prefix (e.g. [Synced]) to every event title before writing it to the target calendar.
Use case: When merging multiple calendars into one view, prefixes help you quickly identify which calendar each event came from.
function gate(event: GateEvent): GateResult {
return { pass: true, transform: { title: `[Synced] ${event.title}` } };
}
How It Works
The transform.title field on the GateResult lets you rewrite the event's title. Using a template literal, you can prepend text to the original event.title so the result still contains the real meeting name alongside the prefix.
Customization
Use a different prefix:
function gate(event: GateEvent): GateResult {
return { pass: true, transform: { title: `[Work] ${event.title}` } };
}
Add an emoji prefix:
function gate(event: GateEvent): GateResult {
return { pass: true, transform: { title: `🗓 ${event.title}` } };
}
Conditionally prefix only recurring events:
function gate(event: GateEvent): GateResult {
if (event.recurrence && event.recurrence.length > 0) {
return { pass: true, transform: { title: `[Recurring] ${event.title}` } };
}
return { pass: true };
}
Prefix based on time of day:
function gate(event: GateEvent): GateResult {
const prefix = event.hour < 12 ? '[AM]' : '[PM]';
return { pass: true, transform: { title: `${prefix} ${event.title}` } };
}
Related Recipes
- Redact Event Titles -- Replace titles entirely instead of adding a prefix