Published on Aug 31, 2021

Dynamic Gravity Forms Entry Field Value Conditional Redirect using ACF Pro

Sridhar Katakam

In the Oxygen Discord live chat, a user asks:

This members-only tutorial provides the steps to

  1. register a Advanced Custom Fields Repeater having Number and URL sub fields on an Options page using ACF Pro
  2. use Gravity Forms' gform_confirmation filter to set up conditional redirect to the URL corresponding to the submitted number by looping through the repeater's rows

for setting up a dynamic system wherein the site owner can enter numbers and corresponding URLs in the Options page so that when a visitor inputs a number and submits the Gravity Forms form, they will be redirected to different URLs depending on the number entered as set in the Options page.

Step 1

Let us first create a simple form with a single Number field and set up static conditional redirects. After that, we will add ACF Pro and make it dynamic.

Install and activate Gravity Forms.

Create the form.

Go to Settings → Confirmations and edit the default confirmation.

Change the Confirmation Type to Redirect and enter your desired default Redirect URL.

Step 2

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: Gravity Forms Entry Field Value Conditional Redirect

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $499 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right