Filtering Automations

How to make sure automations only run when certain criteria are met.

Updated over a week ago

Automations run on all actions by default, but after you choose a trigger you have the option adding filter to only run the automation when it matches certain specified conditions -- such as signups on specific pages, or donations over certain dollar amounts.

Filtering your triggers requires first selecting the "Filter Automation" option, and then pasting some JMESPath code, like this:

When you select the "Filter Automation" option, you'll see a link to the "JMESPath Playground" where you can test out your JMESPath code.

Below are are few examples of JMESPath code, but please reach out to support if you have questions about how to use this feature, or need help writing JMESPath code to filter your triggers.

Only run automation if a person has (or doesn't have) a particular tag (Click to Expand)

To only run an automation if someone DOESN'T have a particular tag, use the following code.

!person.tag_list [?contains(@, 'volunteer-leader')] 

To only run an automation if someone DOES have a particular tag, use the following code:

person. tag_list [?contains(@, 'volunteer-leader' )] 

Note that this needs to be a tag’s “unique identifier.” In the example above, the original tag was “Volunteer Leader.” A tag’s unique identifier is always lowercase and don’t have any spaces. Any spaces in tags should be replaced by dashes.

Action Network: only run automation when a specific form is submitted (Click to Expand)

action."osdi:submission"."_links"."osdi:form".href == 'https://actionnetwork.org/api/v2/forms/416c031d-7c9d-4147-90cf-d9p0d5rc18e9'

When using this code, you'll need to swap in the appropriate URL for your form. This can be obtained by navigating to manage your action in Action Network, scrolling down, and copying the link that says "API ENDPOINT & FORM ID" section, like this:

EveryAction: only run automation when a specific form is submitted (Click to Expand)

action.form.form_id == `1234567`

When using this code, you'll need to swap in the appropriate Form ID for your EveryAction form.

ActBlue: only run automation when a donation is above a specific amount (Click to Expand)

action.contribution.totalAmount.to_number(@) > `100`

When using this code, you can swap in whatever minimum amount you choose -- just replace 100 with any other number.

Mobilize: only run automation on specific event (Click to Expand)

action.event.external_id == '1234'

When using this code, you can swap in whatever your numerical event ID is.

Did this answer your question?