At Appnovation we're always exploring new technologies and industry trends, and proposing these cutting edge technologies to our customers. For one of our potential customers there was a business case for which we wanted to use Cloud Firestore and Contentful. The requirement was to sync data between both the systems. For the integration piece, we decided to explore Zapier.
The following steps were taken to build the PoC:
Create free accounts on Zapier and Contentful
Create collection and document in Cloud Firestore
Log into Google and go to the Firebase Console:
Created a project blog-test:
Created a Cloud Firestore database in test mode:
Create a collection named “users”:
Add a document to the collection with 3 fields as follows:
Add few more documents with the same schema to the collection.
3. Log into Contentful
Create “users” content type :
Add 3 fields to the content type, “fname”, “lname” and “email” and Save:
Log into Zapier
Click on “Make a Zap”:
First we will create a Zap where we will send data from Cloud Firestore to Contentful:
Follow the screens where you will be asked to add the Google Project Id and the account through which Zapier can connect to your Cloud Firestore. In the end you should get to the following screen:
On the next screen you have to select the collection from where the data will be synced with Contentful and add the OrderBy Query as following. Click Continue, if there are errors with your OrderBy clause they will be displayed on the next screen:
If the configuration in above screens are correct then you will be displayed with the following screen. Here Zapier retrieves 2 documents that were added on Firestore and shows it as Record A and Record B. Select Record A and continue:
Now, we move onto the next step where we configure Zapier to create a New Entry in Contentful. Select Contentful and click Continue.
Select the Action as “Create Entry as below and click Continue.
On the next few screens, connect your Contentful account with Zapier.
Test your connected account by clicking the Test button. If your configuration is correct you should get the following on your screen:
Select Content Space, Content Type and the fields mappings on the next screen, as seen below:
Now it is time to test the integration where the data from Cloud Firestore will be sent to Contentful. Click the Send Test To Contentful button:
If the Test was successful you will see the following screen. Click Finish and name your zap on the next screen and turn it on:
Go to Contentful and check if an entry for John Doe was created as below:
Here we went through the entire process of syncing new data only, one-way from Cloud Firestore to Contentful using Zapier. Next, you should try and create a Zap for syncing data from Contentful to Cloud Firestore. One issue observed is that data syncing is only for new data, through Zapier. Zapier doesn’t have triggers to take action when data is updated on either end.