Google Contacts
Search, read, create, update and delete contacts as a connected Google account.
The Google Contacts app reads and writes the contacts of a connected Google account.
A worked example
Google Contacts — add the sender of an email, if they are not already a contact.
- An Email trigger starts the run.
- A Google Contacts step, Contact · Search contacts, with Search text set to
{{ trigger.from.address }}. It answers an array of matching contacts, soitemCountis0when the sender is new. - An If / Else on
{{ upstream.search.output.itemCount }}equal to0. - On the true branch, a second Google Contacts step, Contact · Create a contact, with
Email address set to
{{ trigger.from.address }}and First name to{{ trigger.from.name }}. The Email trigger'sfromis a{ name, address }pair, not a string — see Triggers.
To change a contact instead, run Get a contact first and pass its etag to Update a contact.
Google refuses an update carrying a stale etag, which is what stops two workflows overwriting each
other's edits — so the Get is part of the operation, not an optimisation.
Fill in both halves of a pair you touch. Google replaces a whole field group at a time, so an update that sets First name and leaves Last name empty clears the last name; the same goes for Company and Job title. The Get you already ran carries both, so pass the half you are not changing straight through.
Operations
The App step's own settings — account, resource, operation, and { value, valueMode } per input — are described in the Apps overview. These are this app's operations.
| Operation | What it does | Inputs (bold = required) | Permission |
|---|---|---|---|
contact.search | Search contacts | query, pageSize | contacts.readonly |
contact.get | Get a contact | resourceName | contacts.readonly |
contact.create | Create a contact | givenName, familyName, email, phone, company, jobTitle, notes | contacts |
contact.update | Update a contact | resourceName, etag, givenName, familyName, email, phone, company, jobTitle, notes | contacts |
contact.delete | Delete a contact. Cannot be undone. | resourceName | contacts |
contact-group.list | List contact groups | — | contacts.readonly |
Example
name: Find sender
description: Looks the sender of an email up in Contacts.
graph:
nodes:
- id: start
type: trigger_manual
position: { x: 0, y: 0 }
data: { description: 'Run it from Studio.' }
- id: search
type: app
position: { x: 280, y: 0 }
data:
app: google-contacts
version: 1.0.0
resource: contact
operation: search
connection: google-account
inputs:
query: { value: '{{ trigger.from.address }}', valueMode: expression }
pageSize: { value: '5', valueMode: fixed }
edges:
- { id: start-to-search, source: start, target: search }In a Package
The step travels whole; the account becomes a credential Slot the installer binds one of their own Google accounts to. See Apps in a Package.
slots:
- id: google-account
type: credential
scheme: oauth2
app: google
compliance:
providers: [google]- Travels:
app,version,resource,operation,inputs - Converted:
connectionId→connection(thecredentialSlot) - Never carried: none