Else If statements in Redirect to URL

By: Eli Cohen | Asked: 02/21/2023
ForumsCategory: How-toElse If statements in Redirect to URL
Eli Cohen asked 1 year ago
Hey, how are you?   I am trying to add some logic to my form, so after it submits, if field 454 is equal to "Planning approval not required" or "Not yet started" it redirects to https://buildbuddy.co. Otherwise it should redirect to https://app.buildbuddy.co/register. Here is the logic so far:
[if 454 equals="Planning approval not required"]https://buildbuddy.co[else]https://app.buildbuddy.co/register[/if 454]
  But there doesn't seem to be a way to add an or option in the if statement.   How can I do so?
1 Answers
Victor Font answered 1 year ago
Yes there is: https://formidableforms.com/knowledgebase/conditionals/#kb-else
Eli Cohen replied 1 year ago

That wasn't what I was looking for, I am already using an Else statement, I wanted an if it equals x or y to take the user to one page, but if it equals anything else, to take the user to a different page.

But for some reason, I could not use an "or" in the if statement, but I used the below and it does what I need:

[if 454 equals="Not yet started"]https://buildbuddy.co/[/if 454][if 454 equals="Planning approval not required"]https://buildbuddy.co/[/if 454][if 454 equals="Extension drawings in preparation"]https://app.buildbuddy.co/register[/if 454][if 454 equals="Planning application submitted and awaiting approval"]https://app.buildbuddy.co/register[/if 454][if 454 equals="Planning approved "]https://app.buildbuddy.co/register[/if 454]

Victor Font replied 1 year ago

This is different from your original, which asks only about using if statements. The is no "OR". What you did in your comment above is correct although you could have done it with the equals and then a not_equals that would cover everything else.

Steve WellsSteve Wells replied 1 year ago

Have you seen the new Confirmation form action in 6.0? You can add multiple redirect form actions and each can have their own conditional logic.

Using the form action conditional logic in 6.0 is much easier than stringing together shortcode logic in a single redirect field.

You could do something like Do this action if ANY of the following match:
Redirect to https://buildbuddy.co if
- 454 is equal to Planning approval not required
- 454 is equal to Not yet started

Then have another form action to redirect to https://app.buildbuddy.co/register

In that use case, the form will redirect to https://app.buildbuddy.co/register unless field 454 is equal to "Planning approval not required" or "Not yet started"

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community