Mirra
Building with MirraScriptsEvents Reference

Google Sheets Events

Automate workflows based on spreadsheet changes

Google Sheets events fire when spreadsheets are updated in your connected Google Drive. These events capture spreadsheet metadata and modification times.


Event Types

google-sheets.spreadsheet_updated

The google-sheets.spreadsheet_updated event fires when a Google Sheets spreadsheet is updated.

Event Type:

type: 'google-sheets.spreadsheet_updated'
source: 'google-sheets'

Fields:

content.text (string)

Spreadsheet title.

sheets.spreadsheetId (string)

Google Sheets spreadsheet ID.

sheets.title (string)

Spreadsheet title.

sheets.sheetCount (number)

Number of sheets in the spreadsheet.

sheets.webViewLink (string | null)

URL to view the spreadsheet in Google Sheets.

sheets.lastModifiedTime (Date | null)

When the spreadsheet was last modified.

Example - Spreadsheet Update Notification:

export async function handler(event, context) {
  await mirra.telegram.sendMessage({
    chatId: 'your-chat-id',
    text: `📊 Spreadsheet Updated\n\nTitle: ${event.sheets.title}\nSheets: ${event.sheets.sheetCount}\n\nView: ${event.sheets.webViewLink}`
  });
  
  return { success: true };
}

Example - Change Logger:

export async function handler(event, context) {
  await mirra.memory.create({
    type: 'spreadsheet_update',
    content: `Spreadsheet "${event.sheets.title}" was updated`,
    metadata: {
      spreadsheetId: event.sheets.spreadsheetId,
      sheetCount: event.sheets.sheetCount,
      modifiedAt: event.sheets.lastModifiedTime,
      url: event.sheets.webViewLink
    }
  });
  
  return { success: true };
}

Subscription Examples:

// All spreadsheet updates
{
  "eventType": "google-sheets.spreadsheet_updated"
}
 
// Specific spreadsheet
{
  "eventType": "google-sheets.spreadsheet_updated",
  "conditions": [
    {
      "field": "sheets.title",
      "operator": "contains",
      "value": "Budget"
    }
  ]
}

See Also

On this page