Guide: All you need to know about Gravity Forms merge tags

All you need to know about Gravity Forms merge tags

Written by Casey Burridge Marketing Coordinator at GravityKit since 2021, Casey is an expert on Gravity Forms, WordPress, and marketing.

Last updated:

Categories Gravity Forms

Tags

Are you looking for guidance on how to use merge tags to display Gravity Forms field values? 

Merge tags in Gravity Forms allow you to display data about a form, an entry, or a specific field. You can use merge tags inside confirmations, notifications and post content templates.

In this article, we’re going to explore merge tags in Gravity Forms and how you can use them to display field values dynamically. Keep reading to find out more!

What are Gravity Forms merge tags?

Merge tags in Gravity Forms allow you to dynamically display user submitted field values in confirmation messages, notification emails and parts of your website.

Merge tags consist of words and numbers enclosed in curly brackets, like this: 

{field name:4}

The first part of the merge tag is the field label. After that comes the field ID. You can also add an optional modifier to the merge tag, depending on the data you want to display. In that case, the merge tag will look like this:

{field name:4:modifier}

💡 Pro tip: The field label is NOT required for the merge tag to work. All you need is the correct ID. So, in other words, a merge tag like this {:4} will still work.

Every form you create has a unique ID and every field within that form also has an ID. That means you can display user submitted data from nearly any field type using merge tags. 

But merge tags aren’t limited to form field values. In fact, there are many merge tags available in Gravity Forms that allow you to display different information. This includes information about the form, a form entry, the user, the date, and more.

How to use Gravity Forms merge tags

Now that you know what Gravity Forms merge tags are and what they can do, let’s take a look at how to use them on your website. You can use merge tags to dynamically display different information, including:

  • Form field values 
  • Information about the entry
  • User properties
  • Post field values
  • The current date
  • Product orders
  • And more…

Let’s say you want to display the user’s name in the confirmation message. You can either construct the merge tag manually by locating the ID of the Name field, or you can use the Gravity Forms merge tag picker.

Let’s look at the manual way first. To find the field ID, go to your form editor, and click on the field. You’ll see the ID next to the field name in the right-hand panel.

An arrow pointing to the ID of a field in Gravity Forms

The Gravity Forms Name field is made up of multiple inputs. In fact there are 5 possible inputs for prefix, first name, middle name, last name and suffix. Here’s how you would display the first name:

{Name (first):1.3}

The first number is the field ID (1) and the second number following the decimal point is the input ID for the first name input box.

Alternatively, you can just use the Gravity Forms merge tag picker to automatically insert merge tags into confirmations or notifications.

The merge tag button above the confirmation message box in Gravity Forms

The merge tag picker icon {..} is next to the “Add Media” button. Clicking that will bring up a list of form fields for you to select from. After selecting a field, the correct merge tag will automatically be inserted for you.

Adding merge tags to confirmation messages

Here are the steps for adding user field values to Gravity Forms confirmation messages.

Hover over Forms and click Forms. Next, hover over your form and click on the Settings link. Now click on Confirmations on the left. Edit the default confirmation message or create a new one, scroll down to the text editor, click on the merge tag picker and select the field value you want to display dynamically in the confirmation message.

Adding merge tags to notification emails

The steps for adding merge tags to notification emails are the same as for confirmation messages. All you need to do is go to the form settings and click on the Notifications tab on the left.

The Notification tab on the Gravity Forms Settings page

Now, scroll down to the message box and click on the merge tag picker to select the field value you want to display.

Merge tag modifiers

Modifiers are optional additions to merge tags that give you finer control over the information being displayed. You can add modifiers after the field ID, like this:

{field name:4:modifier}

Here is a list of some of the modifiers:

  • :label – display the field label.
  • :value – display the item’s value (only applies to Drop Down, Checkbox and Radio Button fields)
  • :price – display the selected product’s price in numeric format
  • :currency – display the selected product’s price in currency format

💡 Pro tip: You can see a full list of merge tag modifiers here.

Gravity Forms merge tag examples

Here are some examples of different ways to use merge tags to display different information.

1. Displaying the value of a field choice from a Drop Down field:

{Drop Down:3.2:value}

2. Displaying the field label of Single Line Text field:

{Single Line Text:4:label}

3. Displaying the current date in DD/MM/YYYY format:

{date_dmy}

4. Displaying the form title:

{form_title}

5. Display the ID of the WordPress user who created the entry (submitted the form):

{entry:created_by}

💡 Pro tip: If you’re looking for a full list of Gravity Forms merge tags, check out the Gravity Forms documentation.

Can you add Gravity Forms merge tags to a page?

Gravity Forms merge tags allow you to dynamically display field values in confirmation messages, notification emails, and post content templates. However, you can’t add merge tags to pages or posts. 

The best way to display Gravity Forms field values on the front end is by using GravityView.

GravityView is an add-on for Gravity Forms that allows you to display your form entries on pages or posts and create powerful web applications using Gravity Forms.

Can you display Gravity Forms field values on the front end using merge tags?

Merge tags allow you to display form field values in confirmation messages or notification emails, but they don’t work on regular pages. If you’re looking for a way to display Gravity Forms data on different parts of your website using different layouts, check out GravityView.

The GravityView icon

Can you add Gravity Forms merge tags to HTML fields?

In Gravity Forms, there is an HTML field type that allows you to add custom HTML content to your forms, including shortcodes. However, adding merge tags to an HTML field won’t work because populating fields in the form with information from other fields in the form cannot be done natively in Gravity Forms.

If you need a way to do this, you’ll need to get the Populate Anything Perk by Gravity Wiz.

Gravity Forms merge tags not working? Try this

There may be several reasons for why your merge tags aren’t working properly. If you’re having trouble displaying user field values using Gravity Forms merge tags, try the following solutions:

Check the merge tag for errors

Most of the time you’ll find that the reason your merge tag isn’t working is because there’s an error or typo in the tag itself. Double-check the field ID and ensure you’re using curly brackets like this “{” and not square brackets like this “[”.

Check to see where the merge tag was placed

Gravity Forms merge tags don’t work everywhere. If merge tags aren’t working for you, check to see where they have been added. Here are some areas on your site where merge tags WON’T work:

  • Pages or posts (for this, use GravityView instead)
  • Inside WordPress widgets
  • Inside a Gravity Forms HTML field

Check to see if your form has been altered

If your merge tag is error-free and it’s still not working, check your form to see if it’s been altered. Maybe the field you’re trying to display was removed, or replaced with a different field that has a new ID. If that’s the case, you’ll need to update the merge tag with the new ID.

Start using Gravity Forms merge tags today!

Merge tags in Gravity Forms allow you to display form field values dynamically. Using merge tags you can display data about a form, an entry, a specific field, and more. 

Merge tags work in confirmation messages, notification emails, and post content templates. However, you can’t use merge tags to display Gravity Forms data on pages or posts. For that functionality, you’ll need GravityView.

In you found this post helpful, sign up for our newsletter below! 👇

Helpful tips right in your inbox.

Subscribe to our weekly newsletter for tips, special offers, and more!

Helpful tips right in your inbox.

Subscribe to our weekly newsletter for tips, special offers, and more!