Info | ||
---|---|---|
| ||
...
To begin setting up your integration you will need the following:
...
An account with Zapier
A project space on CommCareHQ with an application.
Have submitted a form with the application you want to setup the integration for.
A google sheet setup to collect your data.
Setup Google Sheet
Before we begin to create a zap, we should set up a Google Sheet where we will collect the data.
Proceed to Google Sheets
- Create a new sheet
Open the sheet
Select one of the tabs in the sheet and enter the following text in the first row of the sheet:
caseid | casename | timestart | timeend | username |
---|
These are the basic fields we will be collecting data for in this integration. You can create headers for any piece of data that your form collects. During the setup of the Zap, you will be given the option to map data collected by your form to the headers you set up in your google sheet. Be sure to name the sheet something you can easily remember or find, as you will need it later in the setup.
Now that our sheet is set up to collect data, we can set up our zap!
.
Setup CommCare Trigger
Proceed to your Zapier and log in to your account.
If you have not created an account, proceed to www.zapier.com and sign up for one.
Once logged in, select Make a Zap at the top of the page
On the next page, you will be prompted to ‘Choose a Trigger App.’ Search for and select CommCareHQ.
For ‘Select CommCare’ trigger, choose New Form. This should be the only option you can choose. Select continue.
When on the page that asks you to ‘Select CommCareHQ Account,’ select create a new account.
A new window should pop up asking for your username and API key.
The user name should be a web user account that you login to CommCareHQ with.
The API Key can be found by proceeding to My Account Settings of CommCareHQ. Select the Gear icon in the top right, followed by My Account Settings:
On the My Information page, you should see the API key. Copy and paste this string into the corresponding field in Zapier:
You should now be on the Set up CommCareHQ Form
Select the Domain, Application and Form that you would like to trigger the action for. Select continue once you choose the form.
NOTE:You need to have submitted a form for the application you are setting the zap up for. It does not matter when this form was submitted, just that the application has been used before. If you're defining your domain through Use a Custom Value, you must enter your domain as it appears in your browser's URL. For example, a project named Zapier Test Domain will appear in the URL as "zapier-test-domain" and must be entered into Zapier as such.
After selecting the Domain, Application and Form, you will be brought to a page where you can test the setup. Select ‘Fetch and Continue’
...
If step 8 does not succeed, ensure that you have set up the integration as a Web User and not a mobile worker. For clarification on the difference, please proceed to the following page
Setup Action
After setting up the trigger, you should be prompted to add an Action. Select to add one.
Choose Google Sheets.
For an action, select Create Spreadsheet Row. Select ‘Save + Continue.
You should now be on Select Google Sheets Account. Click Connect a New Account and allow Zapier access. When you click continue, you will be prompted to link the Spreadsheet and Worksheet you've created.
On the Set Up Template page, select the Spreadsheet dropdown. Select the spreadsheet you just set up.
Select the worksheet that you added the headers to. The headers should now appear as drop down fields beneath the worksheet field.
Proceed to match up the column headers as follows:
username = Form Meta Username
- timestart = Form Time Start
- timeend = Form Time End
- caseid = Form Case @case ID
- case_name = Form Case Create Case Name
After matching up the fields, select continue.
You should be brought to a page where you can test the integration. Select Create and Continue.
You should receive a notification that the action was successful or not.
If successful, proceed to the spreadsheet and confirm it now has some data in it!
If unsuccessful, please review the steps to ensure everything is setup correctly.
- After receiving the notification that the action was successful, select Finish.
- Turn on your zap!
Congratulations! You've now set up your CommCare zap! You should now be able to submit forms and have them populate in the google sheet that was setup.
You can also set up CommCare to trigger a number of actions, so feel free to try others besides Google Sheets!With your CommCare Trigger now set up, we need to set up the action that will occur!
Applications to Integrate With
Google Sheets