# Google Docs

Create, read and edit documents in Google Docs.

## Connect Google Docs

1. In the sidebar, open **Connections** and press **Add connection**.
2. Type `docs` and choose **Google Docs**.
3. Press **Sign in with Google**.
4. Choose your account in Google’s window and allow access.

You should see **Signed in as** and the account’s address. GoRunner can then see and edit the documents your workflows open.

You can also connect from a step: under **Connection**, press **New**.

**What if it says “Google sign-in isn’t set up here”?**

This installation has no Google app yet. An admin of the installation sees **Set up Google sign-in** instead, and sets it up once for everyone:

1. In Google Cloud, create an OAuth client of type **Web application**, and turn on the API for Google Docs.
2. In GoRunner, copy the **Redirect address to add in Google Cloud**, and add it to the client.
3. Paste the **Client ID** and **Client secret**, then press **Save and sign in**.

Publish the app in Google Cloud. An app left in Testing signs everyone out after 7 days.

Everyone else sees who to ask. Until it is set up, **Paste an access token instead** lets you try a step. A pasted token lasts about an hour and can’t renew itself.

[Set up Google sign-in for connections](https://docs.gorunner.io/self-host/oauth-apps)

**Can I use my own Google app?**

Yes. In the sheet, open **Use your own Google app** and paste its **Client ID** and **Client secret**. Add the **Redirect address to add in Google Cloud** to your app first. The connection then signs in through your app instead of the installation’s.

[Connections](https://docs.gorunner.io/build/connections) says how to sign in again, rename or delete it. In a product that embeds GoRunner, **Add connection** can be missing: then [your provider makes connections](https://docs.gorunner.io/embed/customer-connections) for you.

## Do things in Google Docs

Add a **Google Docs** step and choose an **Operation**. Choose the row to see the fields of each.

- [Google Docs](https://docs.gorunner.io/apps/google-docs#fields-f-googledocs): Create Document · Append Text · Replace Text · Read Document

To start a workflow from Google Docs, use a [Schedule](https://docs.gorunner.io/apps/schedule), [Webhook](https://docs.gorunner.io/apps/webhook) or [Form](https://docs.gorunner.io/apps/form) trigger.

Later steps read a step’s output by its name: see [Use data from earlier steps](https://docs.gorunner.io/build/use-data-from-earlier-steps).

Not in your list? See [When an app isn’t here](https://docs.gorunner.io/apps/when-an-app-isnt-here#q-not-in-list).

## For developers

In the API, which calls apps pieces, Google Docs is `pieceId: "googledocs"` with `actionId: "googledocs"`, set by `operation`. [Get an app](https://docs.gorunner.io/api/apps/get-app) returns every field.

It can change something outside the run (`writes_external`). See [How versions and side effects work](https://docs.gorunner.io/apps#q-versions).

### Google Docs › Google Docs

Documents.

### Create Document

- **Title · Required**: The new document's title.

### Append Text

- **Document ID · Required**: The document id.
- **Text · Required**: The text to append.

### Replace Text

- **Document ID · Required**: The document id.
- **Search Text · Required**: The text to find.
- **Replace With · Required**: The replacement text.

### Read Document

- **Document ID · Required**: The document id.

Source: https://docs.gorunner.io/apps/google-docs
