Skip to main content
Question

Conditional triggering


Hi,

I am building an integration (a Zapier application) with API that does not support conditional webhook; so it fires all events on a configured webhook and provides a type of event fired in a POST body, json, a kind of:
{
   event_type: “xxx”, 
   event_specific_data” {

      xxxxxxxxx
   }
}

 

I build an UI, a combo with multiple choice, with the list of event_types to choose. 

How can I prevent from firing trigger based on selected in UI types and and event type? In other words, can I stop running workflow programmatically based on some business rules.

Thank you!

Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

GetUWired
Forum|alt.badge.img+12
  • Zapier Expert
  • 1030 replies
  • July 27, 2022

Hi @Dmitry Karpezo 

In short, yes this is possible. You will need to check in your Perform request the event type before returning anything. https://platform.zapier.com/cli_tutorials/resthooks#step-3-write-the-perform-function 

Assuming the input variable in the trigger is also called event_type your check might look something like this

 


shalgrim
Forum|alt.badge.img+8
  • Zapier Staff
  • 406 replies
  • August 18, 2022

Hey Dmitry,

Yep, GetUWired has it right here. If you’re using CLI, then the check would be in your trigger’s read_hook method