Use Google Calendar free/busy status in conflict rules

Google Calendar lets people mark an event as Busy or Free. By default, every event GoMeddo syncs from Google Calendar blocks that person's time, including events marked as Free. This guide shows you how to bring the free/busy status into GoMeddo and use it in a Conflict Rule, so events marked as Free in Google Calendar no longer block bookings.

Before you start: you need the Google Calendar integration set up and syncing, Conflict Rules enabled in GoMeddo settings, and permission to create custom fields and custom metadata records. See Conflict Rules for how to enable them.

How it works

You create a field on Reservation, then add a Sync Field Mapping that copies the event's free/busy property into that field. A Conflict Rule can then ignore overlapping reservations whose field says the event is free.

Google Calendar stores the status in the event's transparency property:

Value

Shown in Google Calendar as

transparent

Free (Available).

opaque

Busy. Google usually leaves the property out for busy events, so the field stays empty.

Create the free/busy field on Reservation

  1. Go to Setup > Object Manager.

  2. Open Reservation and click Fields & Relationships.

  3. Click New.

  4. Select Text as the data type.

  5. Enter Google Free Busy as the Field Label and set Length to 20.

  6. Check that the Field Name is Google_Free_Busy.

  7. Give access to the profiles that use GoMeddo.

  8. Click Save.

Use a Text field. Formula fields cannot be written by the sync, and other field types can fail when Google sends a value they don't accept. You can use a different field name, as long as you use the same API name in the rule later on.

Map the Google property to the field

  1. Go to Setup > Custom Metadata Types.

  2. Click Manage Records next to Sync Field Mapping.

  3. Click New.

  4. Enter a Label, for example Google Free Busy, and a Sync Field Mapping Name.

  5. Set Type to Google.

  6. Set sObject Type to Reservation.

  7. Set sObject Field to Google Free Busy.

  8. Enter transparency in API Field.

  9. Make sure Is Active and Is Editable are both enabled.

  10. Click Save.

From the next sync onwards, the field holds the free/busy value of each synced event. Existing reservations get a value the next time their event changes in Google Calendar.

The mapping works in both directions. If someone edits Google Free Busy on a reservation in GoMeddo, that value is sent to the Google Calendar event. Only enter transparent or opaque, spelled exactly as shown.

Update the Staff already booked rule

You can't edit the formula of a default Conflict Rule, so you replace the default Staff already booked rule with a copy that ignores free events. We recommend changing only the Staff rule. A reservation can hold both a staff member and a room, and you usually want the room to stay booked even when the organizer marks the meeting as Free.

  1. Go to the Conflict Rule tab.

  2. Open the Staff already booked rule.

  3. Clone the rule.

  4. In the clone's formula, add the free/busy condition inside the FILTER, as in the example below.

  5. Use the syntax checker to validate the formula.

  6. Mark the clone as active and save it.

  7. Open the original Staff already booked rule again.

  8. Mark it as inactive and save it.

The formula looks like this:

B25__Status__r.B25__AllowDoubleBooking__c != true AND COUNT(FILTER(overlappingReservations AS rsv, rsv.B25__Status__r.B25__AllowDoubleBooking__c != true AND rsv.Google_Free_Busy__c != "transparent")) > 0

Start from the formula your own rule already has, since it can differ between GoMeddo versions, and add only the AND rsv.Google_Free_Busy__c != "transparent" part inside the FILTER. An empty field counts as busy, so busy events and reservations synced before you added the mapping keep blocking time.

The new rule is now active, and events marked as Free in Google Calendar no longer block that staff member.

Verify the configuration

  1. In the connected Google Calendar, create an event and mark it as Free.

  2. Wait for the next sync run.

  3. Open the synced reservation in GoMeddo.

  4. Check that Google Free Busy shows transparent.

  5. Book the same staff member at the same time.

GoMeddo saves the booking without a double-booking conflict. If you repeat the test with an event marked as Busy, the booking is blocked.