Overview
This webhook allows you to provide a formula as if using a Google sheets spreadsheet and receive back the calculated result. You may specify optional formatting for the cell. The formula must be provided in the "formula" parameter, and should be written in the same way as you would write it in a cell in Google Sheets. You can also specify optional formatting parameters, "format" and "pattern", which will be used in the Google Sheets API as the "numberFormat.type" and "numberFormat.pattern" respectively.
Requirements
- Kapturall Actions API Key
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
formula | string | yes | The formula to be applied to the cell. |
format | string | no | The format to be applied to the cell. |
pattern | string | no | The pattern to be applied to the cell. |
Response Parameters
Parameter | Type | Description |
---|---|---|
formula | string | The formula that was applied to the cell. |
format | string | The format that was applied to the cell. |
pattern | string | The pattern that was applied to the cell. |
numberFormat | object | An object containing the "type" and "pattern" of the formatting applied to the cell. |
ref | string | The reference of the cell that was modified. |
result | string | The result of the formula applied to the cell, with any applied formatting. |
raw_result | string | The raw result of the formula applied to the cell. |
Installation
Go to the Admin area.
![](https://experienceleague.adobe.com/docs/marketo/assets/create-a-webhook-1.png?lang=en)
Click Webhooks.
![](https://experienceleague.adobe.com/docs/marketo/assets/create-a-webhook-2.png?lang=en)
Click New Webhook.
![](https://experienceleague.adobe.com/docs/marketo/assets/create-a-webhook-3.png?lang=en)
Enter the url & JSON with formula
![](https://www.kapturall.com/wp-content/uploads/2023/01/Formula-Webhook-screenshot.png)
The JSON should include at minimum the attribute formula
Parameter | Type | Required | Description |
---|---|---|---|
formula | string | yes | The formula to be applied to the cell. |
format | string | no | The format to be applied to the cell. |
pattern | string | no | The pattern to be applied to the cell. |
{
"formula": "3/5",
"format": "percent",
"pattern": "0.000%"
}
Set Authorization Header
You will need to pass your Kapturall API Key in the header to authorize the call
Click EDIT next to Custom Headers
![](https://www.kapturall.com/wp-content/uploads/2023/01/webhook-add-header-1.png)
Click + Add then enter x-api-key as the header and your Kapturall API key as the value. Then click Save
![](https://www.kapturall.com/wp-content/uploads/2023/01/Webhook-Header-2-2.png)
Set Response Mapping to return the formula value to a specific field
Click EDIT next to Response Mappings
![](https://www.kapturall.com/wp-content/uploads/2023/01/Webhook-Response-mapping-1.png)
Click + Add and enter any of the given response parameters as the Response Attribute. Then select the Marketo field you would like the value stored in. Once you have set all of the mappings you want, click Save
![](https://www.kapturall.com/wp-content/uploads/2023/01/Webhook-Response-Mapping-2.png)
Response Parameters
Parameter | Type | Description |
---|---|---|
formula | string | The formula that was applied to the cell. |
format | string | The format that was applied to the cell. |
pattern | string | The pattern that was applied to the cell. |
numberFormat | object | An object containing the "type" and "pattern" of the formatting applied to the cell. |
ref | string | The reference of the cell that was modified. |
result | string | The result of the formula applied to the cell, with any applied formatting. |
raw_result | string | The raw result of the formula applied to the cell. |
Usage
Once configured, you should see the action available to add to smart campaigns under
Add the Call Webhook flow action to smart campaign
![](https://experienceleague.adobe.com/docs/marketo/assets/image2014-9-22-15-3a8-3a2.png?lang=en)
Then select the webhook you have created from the dropdown
![](https://www.kapturall.com/wp-content/uploads/2023/01/Screenshot-2023-01-05-at-5.17.45-PM.png)
For more information on using webhooks in smart campaigns, checkout the Marketo documentation
Writing Formulas
This webhook uses Google's Sheets API to calculate the formula results. Please refer to the Google Sheets function list when writing formulas.