Configuring the Action
Now from this point we have established the following setup:
- Sets up a trigger that instantly fires when we create a new Object on our specified Cosmic JS Bucket
- (Premium) Set up a flexible Zapier filter to limit proceeding actions to a specific subset of Object Types.
Now for the final step, we need to setup an Action to be performed whenever out new Object is created. While this can be any aforementioned examples, for this example we will be inserting our Cosmic JS Objects into a Google Sheet document.
After creating our filter (or after defining and setting up our initial trigger), we should be redirected to the Action App page. From here we are given the ability to take our Cosmic JS Objects and use them to power events on several other platforms.
From the above screen, search and select the Google Sheets Action icon.
Once it’s been opened, you’ll be addressed with a Select Google Sheets Action page. We want to create a new spreadsheet row each time we add a Cosmic JS Object so we’ll select the Create Spreadsheet Row button.
After pressing Save and Continue you’ll be prompted to sign into your Google account if you haven’t already. Otherwise it’ll prompt you to select an existing account or add a new one.
Once that’s done, it’s necessary to create a new Google Sheet. This way, the Google Sheet integration will have parsable columns to inject the data we will be passing in from. For this example, this is what my own Google Sheet looks like:
You can also use existing spreadsheets, even ones already populated with data
I’ve specified 4 columns that can be detected by the Google Sheet Zapier integration. We will need both the spreadsheet and it’s headers defined before we can use it. We also need to remember the specific sheet (in this case Sheet1) so Zapier knows where to add the content.
After doing this we can resume our signup pro
After specifying the Spreadsheet and Worksheet to load, Zapier will then load the specific headers from the the matching spreadsheet and page and we will be given the ability to specify the data of each new row we add.
The hamburger-like button to the right of the lower fields allows us to inject the fields from out Cosmic JS Objects directly into the cells of the spreadsheet. The interface for doing this should be fairly intuitive, but one thing that’s important to mention that that you can also interpolate text with values from your Cosmic JS Objects.
I already setup another simple Zap that populated by Cosmic JS Bucket with some tweets from my account, so it’s showing those specific values as examples.
After clicking the Continue button, we are then prompted to test the Spreadsheet integration. It’s very similar to the Cosmic JS test so it’s not essential for me to show you.
Once that is done (and after we confirm our spreadsheet with the Finish button), we are then prompted by this screen:
Be sure to turn on the Zap for this next step, since we are going to do a live test of the Cosmic JS integration.
Testing the Instant integration
Navigate to your Cosmic JS Buckets and navigate to the bucket that you’ve used for the Zapier Integration. Then select the the relevant Object Type from the list. For me that Object type is
cool, but for you it can be your preferred type.
Select the + Add … button on the top right. That will bring up the Cosmic JS Object Editor interface. Fill in the fields your that Object:
Then press the Publish button on the top right (as specified by our Cosmic JS trigger)…
And then check your Google Sheet…
Voila, you’ve just hooked up your Cosmic JS account to a Spreadsheet with Zapier!
(which happens immediately after the Object is created, btw)
But what about Creating new Cosmic JS Objects?
The Cosmic JS Integration also supports the ability to create new Objects within a specified Bucket. I’ll let you figure how to do that on your own (hint: it’s almost exactly the same as the Google Sheet setup ?).
Cosmic JS lets you integrate your content into almost any website and application due to the flexibility it has in regards to how you do so (REST endpoints, GraphQL, Webhooks), and now with a Zapier integration it can integrate with so much more!