Basic Rules are available on the Mixmax Growth plan and above. Advanced Rules are available on the Mixmax Enterprise plan only. Check out our pricing page for more information.
In this article, we discuss how to use the Mixmax Webhook Transform Language feature of Mixmax Rules.
By default, when using the Incoming webhook Mixmax Rule, Mixmax will pass on the entire payload (the data, typically in JSON format) of the event to the rule action (under Then). This is often not desired. For example, if you're receiving a webhook from a third-party system with the following payload:
{
"applicant": {
"first_name": "Jane",
"last_name": "Candidate"
"email_addresses": [
"type": "work",
"email": "[email protected]"
]
}
}
and you're using a Mixmax Rule action such as add to sequence that requires email
and name
properties at the root level, you need to set a transform to convert the webhook to:
{
"name": "Jane Candidate",
"email": "[email protected]"
}
In order to do this, you'll need to specify the following webhook transforms:
email = applicant.email_addresses.0.email
name = applicant.first_name + " " + applicant.last_name
This uses Mixmax Webhook Transform Language. Here are more examples of how you can transform webhook properties:
Transform | "Preserve Dots" checked | Description | Before | After |
a = b.c | n/a | Returns a nested property |
|
|
a = b.0 | n/a | Returns the Nth element of an array |
|
|
a.b.0 = z | no | Sets a nested property |
|
|
a.b.0 = z | yes | Sets a property, ignoring dots |
|
|
a = b[index] | n/a | Returns the Nth element of an array, using another property as the index |
|
|
a = b.c + d.b | n/a | Concatenates (joins) two strings |
|
|
a = b.c + d.b | n/a | Adds two numbers (only if inputs are numbers) |
|
|
a = "string literal" | n/a | Sets a string literal (useful for "hardcoding" properties when posting to a webhook) |
|
|
a = b.c + "-" + b.d | n/a | Concatenates with a string literal |
|
|
c = . | n/a | Returns the root object |
|
|
Similarly, when using the post to webhook action (under the Then section), you may apply a transformation to convert the Mixmax-chosen webhook payload into a payload that can be more easily received by your external system.