Integromat: How To Integrate With Coda

#1

EDIT: Integromat now supports Coda functionality natively (https://www.integromat.com/en/integrations/coda)

So quite a few people, myself included, have been hoping for Integromat to integrate with Coda for some time. Whilst a native solution would ultimately be ideal, Integromat has very powerful inbuilt tools to extend itself, which can be combined with the Coda API to get us most of the way there.

TO BE CLEAR: This is a bit of a WIP; I’m no Integromat (or API) expert, nor is this a complete one-to-one integration of the Coda API (yet), but I’ve managed to get some Action Modules working and figured it would be worth sharing that much. My aim is to slowly expand on that starting point, and I’ll keep updating here when I do. Importantly, that means right now I don’t have any Triggers working, but instead am relying on Webhooks to do the work.

What Is Integromat?

Summary

First of all, let’s quickly cover why you might want to use Integromat at all! For those who’ve never heard of the service, think of it as a Zapier rival, but instead of linear logic (if this, then that, then that, end) you can create branching logic (if this, then that, or if else, then the other, then that).

Just like Zapier or IFTTT, Integromat connects third-party services, allowing you to move data around, manipulate it, and output it somewhere else. The power comes from being able to setup logic gates, routing, data stores, webhooks, etc. and directly manipulate data within a Scenario (their equivalent of a Zap or Applet). Want to have a new GitHub pull request automatically create a Card on Trello, assign a user from a list, and then fire a DM to that person on Slack? That’s what Integromat is for. :wink:

Benefits Over Zapier

Whilst Integromat covers a lot of the same ground as Zapier, which already has decent integrations with Coda, it arguably does a couple of things just a bit better, particularly for hobbyist developers:

  1. The free tier is a lot more flexible, being based on number of interactions in a month rather than limiting you to “x” many Zaps/Scenarios.
  2. All users get access to multi-step logic, so you can build some powerful integrations across multiple services without having to pay.
  3. “Live Triggers”, the first step in a Scenario, can be configured to occur in real time, meaning no more delays between an action and an output.
  4. Data Stores allow you to retain the output from one Scenario and utilise it across other ones, letting you create caches of information that can power automation.
Create an Account

So, first step is to get an account (if you don’t already have one) and play around to get an idea of how Integromat works: https://www.integromat.com

Building A Personal App in Integromat

As mentioned, right now Coda doesn’t have a native Integromat integration, but you can build your own instead using a Private App. You can make Private Apps available to your organisation, but for these purposes I’m not going to go into that.

Step One: Create a New App
  1. From your Account, go to My Apps on the left panel: image
  2. Hit Create a New App in the top right; a modal will pop up
  3. Give your App a Name e.g. “coda” or “my-coda-app” (this should be all lower case)
  4. Set the Label to “Coda”
  5. Amend any other details as you want; you can edit any of these at a later date apart from the Name so for now I’d recommend just leaving them as default
  6. Press Save
Step Two: Setup the Base Structure
  1. Paste the following code into the main text entry (overwrite what’s there) and press the Save button that appears top-right (or use Ctrl+S/Cmd+S) image

{
“baseUrl”: “https://coda.io/apis/v1beta1”,
“headers”: {
“Authorization”: “Bearer {{connection.apiKey}}”
},
“log”: {
“sanitize”: [“request.headers.authorization”]
}
}

  1. Leave Common Data with a value of:
{}
  1. Leave Options with the default values
Step Three: Configure a Connection
  1. Click the + button top-right and select Create a new Connection image
  2. Set the Label to “Coda API”
  3. Set Type to “API Key”
  4. Press Save

image

  1. Select the Coda API to open the editing panel
  2. Overwrite the account validation process (main text area) with the following, and then Save:

{
“headers”: {
“Authorization”: “Bearer {{parameters.apiKey}}”
}
}

  1. Leave Common Data as

{}

  1. Go to the Parameters tab and overwrite with the following, then Save:

[
{
“name”: “apiKey”,
“type”: “text”,
“label”: “API Key”,
“required”: true
}
]

At this point, we have a working App within Integromat, but no Modules (the items or methods that you actually use in Scenarios).

Creating Coda Modules

Action: Add Table Row

Initial Module Setup
  1. Click the + button top-right and select Create a new Module image
  2. Select Action from Type dropdown
  3. Select Coda API as the Connection
  4. Choose Create as the Module Action
  5. Input “addTableRow” as the Name
  6. Set the Label to what you want the Module to be called e.g. “Add Table Row” or “Add Row”
  7. Input a Description e.g. “Adds a row to the specified Coda table
  8. Press Save

Configure Module
  1. Select your Add Row Module to go into the editing panel
  2. On the Communication tab, enter the following into the main text area and Save:

{
“url”: “/docs/{{parameters.docID}}/tables/{{parameters.tableID}}/rows”,
“method”: “POST”,
“body”: {
“rows”: [
{
“cells”: [
{
“column”: “{{parameters.colOneID}}”,
“value”: “{{parameters.colOneValue}}”
}
]
}
]
},
“response”: {
“output”: {
“ts”: “{{body.ts}}”,
“channel”: “{{body.channel}}”
},
“error”: {
“message”: “{{body.ts}}”
}
}
}

  1. Select the Coda API as the Connection (if not already present)
  2. Leave the Options as default
  3. Go to the Mappable Parameters tab and enter the following, and Save:

[
{
“name”: “docID”,
“type”: “text”,
“label”: “Document ID”,
“required”: true
},
{
“name”: “tableID”,
“type”: “text”,
“label”: “Table ID”,
“required”: true
},
{
“name”: “rowID”,
“type”: “text”,
“label”: “Row ID”,
“required”: true
},
{
“name”: “colOneID”,
“type”: “text”,
“label”: “Column ID”,
“required”: true
},
{
“name”: “colOneValue”,
“type”: “text”,
“label”: “Column Value”,
“required”: true
}
]

  1. Finally, in the Interface tab input the following and Save:

[
{
“name”: “ts”,
“type”: “text”,
“label”: “Message ID (time stamp)”
},
{
“name”: “channel”,
“type”: “text”,
“label”: “Channel ID”
}
]

  1. Leave the Samples and Static Parameters tabs as they are i.e. empty braces

Action: Update Table Row

Initial Module Setup
  1. Click the + button top-right and select Create a new Module image
  2. Select Action from Type dropdown
  3. Select Coda API as the Connection
  4. Choose Update as the Module Action
  5. Input “updateTableRow” as the Name
  6. Set the Label to what you want the Module to be called e.g. “Update Table Row” or “Update Row”
  7. Input a Description e.g. “Updates a row in the specified Coda table
  8. Press Save

Configure Module
  1. Select your Add Row Module to go into the editing panel
  2. On the Communication tab, enter the following into the main text area and Save:

{
“url”: “/docs/{{parameters.docID}}/tables/{{parameters.tableID}}/rows/{{parameters.rowID}}”,
“method”: “PUT”,
“body”: {
“row”: {
“cells”: [
{
“column”: “{{parameters.colOneID}}”,
“value”: “{{parameters.colOneValue}}”
}
]
}
},
“response”: {
“output”: {
“ts”: “{{body.ts}}”,
“channel”: “{{body.channel}}”
},
“error”: {
“message”: “{{body.ts}}”
}
}
}

  1. Select the Coda API as the Connection (if not already present)
  2. Leave the Options as default
  3. Go to the Mappable Parameters tab and enter the following, and Save:

[
{
“name”: “docID”,
“type”: “text”,
“label”: “Document ID”,
“required”: true
},
{
“name”: “tableID”,
“type”: “text”,
“label”: “Table ID”,
“required”: true
},
{
“name”: “rowID”,
“type”: “text”,
“label”: “Row ID”,
“required”: true
},
{
“name”: “colOneID”,
“type”: “text”,
“label”: “Column ID”,
“required”: true
},
{
“name”: “colOneValue”,
“type”: “text”,
“label”: “Column Value”,
“required”: true
}
]

  1. Finally, in the Interface tab input the following and Save:

[
{
“name”: “ts”,
“type”: “text”,
“label”: “Message ID (time stamp)”
},
{
“name”: “channel”,
“type”: “text”,
“label”: “Channel ID”
}
]

  1. Leave the Samples and Static Parameters tabs as they are i.e. empty braces

Using Coda Modules

The easy part! Once you’ve done all of the above, you should be able to use your Modules in exactly the same way as any other service within Scenarios.

Selecting a Module
  1. Just Create a New Scenario on the Scenarios panel, skip the select a service page and search for Coda when selecting a module. You should see something like this:
    image
  2. Select your Coda service and then pick the Module that you want:
    image
  3. Then fill in the required values:
Creating an API Connection

The first time you use a Coda Module you will need to create a Connection.

  1. Go to your Coda Account page (https://coda.io/account) and generate a new API token image
  2. Back in Integromat, within the Module’s settings, press Add under Connection image
  3. Name your connection however you want (I just use the default)
  4. Copy the Coda API Token to the API Key
  5. Press Continue
  6. Testing: In a new browser tab, go to Connections in the main left panel image and test the API by pressing the Verify button. You should see a image
Getting Document/Table/Column/Row IDs

This is probably the least intuitive step. Right now, I haven’t focused on converting any of the GET requests from the API, so that means you have to manually run these yourself using a tool like Postman and copy them into your Modules. Luckily, the Coda API is well documented (https://coda.io/developers/apis/v1beta1#section/Introduction), so you should be able to work out what you’re doing :slight_smile:

Once I’ve translated some of the other API options to Modules, this step will get easier and possible to do within Integromat itself (though will therefore require an extra token on each run, so if you’re being frugal the manual method may still win out :wink: ).

Prefer a Native Solution?

A direct integration would still be best, so if you want to help increase the likelihood of that happening you can upvote the relevant feature requests on each service:

Integromat: https://www.integromat.com/en/requests/new-app-requests/p/coda
Coda: Add Integromat integration (instead of Zapier)

7 Likes

Add Integromat integration (instead of Zapier)
#2

Hello @Murray_Adcock, awesome stuff man.

Good job.

Let´s try it out.

0 Likes

#3

Thanks, let me know how it goes :slight_smile:

I’m definitely not sure whether Triggers will be possible with the current Coda API (though there must be some functionality that Zapier is using, it doesn’t appear to be public information), but Action and Search modules should be easy to expand upon!

1 Like