You can configure one or multiple webhooks in RaiseDonors to send data to Zapier. Zapier has 1,500+ apps which can take an action from the data being posted through the webhook. This help article will walk you through creating a Zap which receives webhook notifications from RaiseDonors and inserts specific donation information into a Google spreadsheet.
Before getting started
Before beginning this setup process, note that RaiseDonors has a beta integration with Zapier which allows you to use the "app" RaiseDonors has created inside of the Zapier ecosystem - and bypass the need to proceed with manually configuring webhooks. Using the built in App from RaiseDonors will save you considerable time and set you up for automatic updates.
To create the Zap, your account will need to support multi-step Zaps. This Zap will require 4 independent steps.
It will be helpful to review what information is available in webhooks and how webhooks work inside of RaiseDonors.
Help
RaiseDonors support cannot officially provide support for this integration - as it's a custom solution. Please ensure a developer skill set is available to aid you through this process. If you have questions about this process, please drop an email to RaiseDonors Help. Also consider that you can contact Zapier Support for assistance.
Step 1
Create a new Zap in Zapier and select the App "Webhooks by Zapier".
Set the trigger event to "Catch Raw Hook".
Click into "Set up Webhook".
Step 2
Copy the Webhook URL that Zapier has provided.
Log into RaiseDonors and go to Webhook subscriptions.
Create a new subscription and fill in all of the required fields. Paste the value from Zapier into the "Notification URL" field. Please note Format must be JSON and Status must be set to Active.
Click save and head back over to Zapier.
Step 3
Close the first step in the Zap, and create a new Step. Choose the App, "Code by Zapier". And set the "Choose Action Event" to be "Run Javascript".
Click into the next section, "Customize Run Javascript".
Add a new Input Data item with the name "rawBody".
Click the icon to insert a field for the value fo this data item. Select "Raw Body".
For the Code section, supply this Javascript:
var donationObj = JSON.parse(inputData.rawBody);
return donationObj;
Click Continue.
Step 4
Close the second step in the Zap, and create a new Step. Choose the App, "Formatter by Zapier". And set the "Choose Action Event" to be "Utilities".
Click into the next section, "Customize Utilities".
For the Transform, select "Line Itemizer (Create/Append/Prepend)".
A donation can have one project or multiple project associations. This step will allow you to configure the project associations in a donation, into individual line items. The alternative is for Zapier to merge each project association into a comma separated list of values.
Line item group name: Projects
Line item properties: Project.Name, Project.Amount, Project.Code
For the associated values, click the icon to insert a value for each line item property. In the search box, type "Project". Pick the associated properties value - from the 2-Run Javascript section.
Click Send Data and Done Editing.
Note, the display will show the values as comma separated. This is not the end result, Zapier is just indicating which values are associated with the properties.
You can repeat this process for other properties of a donation that may have multiple relationships. Examples include:
- Donation.Donor.Address
- Donation.Address
- ProjectAllocations
Step 5
Log into your Google Spreadsheet account and either create a new spreadsheet or locate the spreadsheet you'll be using. It's important that the spreadsheet has the column headings you wish to capture from the webhook. This could be just a few, or many.
Back in Zapier, add a new step to the Zap, and select "Google Sheets" as the app type. The action type will be "Create Spreadsheet Row(s)". Note, there is another action type named "Create Spreadsheet Row", which does not leverage the line itemizer work you did in step 4. Be sure to select the action type that supports line items!
Click into Choose Account - and walk through the process to authenticate and log into Google Sheets.
Click into Customize Spreadsheet Row. Select the drive, spreadsheet, and worksheet to use.
Click the insert field icon and begin supplying the corresponding values from the webhook information into the appropriate heading. There are a few considerations that are important to understand:
- You will likely never use any values from 1-Catch Raw Hook.
- 2-Run Javascript (Gold) - will contain the majority of the information you will be recording. The exception is any item that you have configured in the line itemizer (Step 4).
- 3-Utilities (Red) - will contain individual line item information from Projects (Step 4).
- 4-Utilities (Blue) - is an example showing that we setup an additional line itemizer for Donation.Address. We'd use this grouping if we needed to pull any/all address information for a donation. Common scenarios for this stem from a donation which includes a product - and thus has a shipping address.
When you are finished configuring all of the properties, click into Send Data. Confirm that data can be received and sent as expected. Verify the Google spreadsheet you've selected has a new row of data from Zapier.