Conditional logic can be used to specify when a certain feed should process based on the form data. This is useful for subscribing users to mailing lists and sending payment information to different services.
Enabling conditional logic for a feed can be done in the feed settings. This will need to be done for each feed associated with the form. If conditional logic is not configured, the form will process the first feed it finds.
Use a feed based on a field choice
In this example we are using conditional logic to determine if the form data should be sent to one of two payment services, either Authorize.Net or Stripe.
First, we add a field to the form which allows the user to choose a payment method. We’re going to use a drop down field labeled Gateway with the choices of Authorize.Net and Stripe.
Then we create a feed for each service via the specific add on’s feed settings page. Conditional logic is enabled and the criteria is set so that the gateway equals the appropriate payment method for that feed. Click here to view a video demonstration.
When the user is on the form, they will be presented with the Gateway field which allows them to select which payment gateway they wish to use. Then when the form is submitted, the conditional logic will determine where the payment information is sent. If they select Authorize.Net as the Gateway, then the payment information will be sent to Authorize.Net. If they select Stripe as the Gateway, then the payment information will be sent to Stripe.
Process a feed only if a field is not Empty
For this case you can use the “is not” operator, leaving the input for the value empty. The example below would create a post using an Advanced Post Creation feed only if a field is not empty.