Workflow action triggers and it looks up the coupon code.
It needs to pass the coupon details to a plugin as a parameter.
The problem arises when the coupon code is invalid. In that case “do a search for” returns nothing and the plugin blows up because it says an expected param was not passed to it.
My question is: Can I do an if…else. So if coupon not found in database, I pass 0 to plugin. But if the coupon is found I pass the coupon value to plugin.
Yes. Just add an only when at the bottom of the action to say Search for Coupons first item is not empty. Then duplicate that action and say only when Search for Coupons first item is empty and pass a 0 or some other way of handling it.