Title: Conditional Logic Feature?
Last modified: August 22, 2016

---

# Conditional Logic Feature?

 *  [bchristman30](https://wordpress.org/support/users/bchristman30/)
 * (@bchristman30)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/conditional-logic-feature/)
 * Hello,
 * Super quick question. Does this plugin have a way to NOT send to the specific
   URL if certain conditions are met?
 * For example
 * if we have dropdown list that says “website error” then that is something we 
   want to stay on wordpress, but if “software bug” is selected we want it to send
   the HTTP POST to our 3rd Party application to submit a support ticket.
 * Basically just depending if something is selected or not should determine if 
   we send off the HTTP POST.
 * Thanks!
 * [https://wordpress.org/plugins/forms-3rdparty-integration/](https://wordpress.org/plugins/forms-3rdparty-integration/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  [myideasagain](https://wordpress.org/support/users/myideasagain/)
 * (@myideasagain)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550853)
 * Bump. This feature would be very helpful, as one could add a ‘Get Email Updates’
   checkbox to any form, and have it used as a Condition for external posting.
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550857)
 * Can you add it as an issue (feature request) on Github?
 * You could write a hook on on [`Forms3rdPartyIntegration_use_form`](https://github.com/zaus/forms-3rdparty-integration/blob/master/forms-3rdparty-integration.php#L406)
   and inspect the `$form` argument, then return false on your condition.
 * Or you could hook to [`Forms3rdPartyIntegration_service_filter_args` later down and set `response_bypass`](https://github.com/zaus/forms-3rdparty-integration/blob/master/forms-3rdparty-integration.php#L489)
   so it skips over the post. You’d have access to already transformed submission
   by then.
 *  [myideasagain](https://wordpress.org/support/users/myideasagain/)
 * (@myideasagain)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550858)
 * Sure, I posted it here:
    [https://github.com/zaus/forms-3rdparty-integration/issues/34](https://github.com/zaus/forms-3rdparty-integration/issues/34)
 * I really appreciate your suggestion, but am not familiar with how to actually
   write the hooks.
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550888)
 * I think something like:
 *     ```
       add_filter('Forms3rdPartyIntegration_service_filter_args', 'forms3rdparty_conditional_send', 10, 3);
   
       function forms3rdparty_conditional_send($post_args, $service, $form) {
           // inspect transformed submission body for presence/lack/value of the desired value
           if( !isset($post_args['body']['my-conditional-field']) ) {
               // set plugin bypass -- will treat this as though it had sent the submission; we don't want the plugin to think it failed
               $post_args['response_bypass'] = array('body' => 'OKAY'); // essentially a success placeholder
           }
   
           return $post_args;
       }
       ```
   
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550914)
 * Did you end up trying that?
 *  [myideasagain](https://wordpress.org/support/users/myideasagain/)
 * (@myideasagain)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550918)
 * I was unable to implement the filter.
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550919)
 * Meaning you didn’t get a chance to try it, or you tried it and it blew up your
   website?
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550920)
 * Ahh jeez…my mistake.
 * I forgot that the `response_bypass` should return a response that looks just 
   like a real `wp_post` response — see source line [https://github.com/zaus/forms-3rdparty-integration/blob/master/forms-3rdparty-integration.php#L507](https://github.com/zaus/forms-3rdparty-integration/blob/master/forms-3rdparty-integration.php#L507)
 * You’re probably getting a ‘physical request failure’ message, right? The function
   should instead return:
 * `$post_args['response_bypass'] = array('body' => 'OKAY', 'response' => array('
   code' => 200));`
 *  [myideasagain](https://wordpress.org/support/users/myideasagain/)
 * (@myideasagain)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550921)
 * I did not feel sufficiently confident trying this on my server.
 *  [esoomllub](https://wordpress.org/support/users/esoomllub/)
 * (@esoomllub)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550925)
 * This is working for me now…. except for one thing. I set up a checkbox for users
   to select when they want to sign up for a newsletter… but the value for that 
   checkbox does not get passed in for me to take action on. I’ve tweaked the checkbox
   for default values… but no luck. When I debug the form submission, I am only 
   seeing my hidden and the text input values being submitted (e.g., I print_r’d
   the $_POST values to see what was being sent). The form HTML looks good too.
 * Anyone have a situation like this? A solution?
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550929)
 * Could you try switching it to a dropdown our radio instead to see if that makes
   a difference? Kinda lame though…
 * Usually a checkbox only shows up at all in the post if it was checked, otherwise
   it won’t be there, so you should be able to use `isset` rather than compare the
   value. It would be different for a radio input, I think, which would include 
   the value.
 * Also, which form plugin are you using? It might affect how it transmits the field.
 *  [HumanATV](https://wordpress.org/support/users/humanatv/)
 * (@humanatv)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550939)
 * Great plugin! Worked great to integrate with our client’s CRM. But, the client
   does have a custom request.
 * If a person selects the following states, it should post to the branch CRM URL.
   
   AL AR CA CO FL GA KS LA IA IL IN MD MI MN NV NC NH NJ NM OK OH OR SC TN TX VA
   WA WI WY
 * If a person selects any other state, it should post to the corp office CRM post
   URL.
 * Thoughts on the hook for this? Thank you!!
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550941)
 * [@humanatv](https://wordpress.org/support/users/humanatv/) — you’re asking for
   something different, please start a new thread.
    But you’d have to use the `response_bypass`
   trick so you can make your own `wp_remote_post` call (see [https://github.com/zaus/forms-3rdparty-integration/blob/master/forms-3rdparty-integration.php#L478](https://github.com/zaus/forms-3rdparty-integration/blob/master/forms-3rdparty-integration.php#L478))
 *  [HumanATV](https://wordpress.org/support/users/humanatv/)
 * (@humanatv)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550947)
 * Thank you zaus! That gets me pointed in the right direction.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Conditional Logic Feature?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/forms-3rdparty-integration.svg)
 * [Forms: 3rd-Party Integration](https://wordpress.org/plugins/forms-3rdparty-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forms-3rdparty-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forms-3rdparty-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forms-3rdparty-integration/reviews/)

## Tags

 * [conditional logic](https://wordpress.org/support/topic-tag/conditional-logic/)

 * 14 replies
 * 5 participants
 * Last reply from: [HumanATV](https://wordpress.org/support/users/humanatv/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/conditional-logic-feature/#post-5550947)
 * Status: not resolved