Do you want to append a string of text (or characters) before and after the Merge Tag output and keep it empty if the field is empty? With the gwp_append Merge Tag Modifier from Advanced Merge Tags you can do that. We’ll walk you through it step by step.
Adding text before Merge Tag output
To add text at the beginning of the Merge Tag output, use the following Merge Tag Modifier:
{Organization:1:gwp_append before=" - "}
Client example: We have a client with Forms that have a Gravity Forms Single Line Text Field where site visitors can enter their organization. This field is not required, because not everybody is part of an organization. In the e-mail that is send we want to add the organisation to the Subject of the e-mail. In case there is an organization filled in, we want to add a space, a dash and another space in front of the output. With the above modifier, we can do that. There will be no dash in case there is no value available.
Adding text after the Merge Tag output
There are also cases where you want to add something after the output, for example adding some kind of metrics or even a whole string in case something is filled in. You can do that like this:
{Organization:1:gwp_append after=" MWh"}
This will output the value (for example a number) and adds the abbreviation of megawatt hour to the output, if the field value is not empty.
Adding text both before and after the Merge Tag ouput
You can also add both text before and after the Merge Tag ouput of the Gravity Forms field. This examples adds a dash in front of the ouput and a dash after the ouput and will only show if there is a value filled in.
{Organization:1:gwp_append before=" - " after=" - "}
Try it in the demo
Our Premium add-ons for Gravity Forms
API Connector
Connect Gravity Forms to External API's: Query the API using form field values and automatically fill other form fields with the API response.
Update Multiple Entries
Trigger the update of multiple entries in a target form by submitting an entry in a trigger form.
JWT Prefill
Fill forms with data you can trust. Prefill Gravity Forms fields with a secure token instead of links with editable url parameters, so your data is accurate, tamper-proof, and ready to use.
Entry to Database
Integrates Gravity Forms with internal or external databases, offering flexible mapping of form fields to database columns and real-time synchronization between entries and database rows.
Read tutorials about
Gravity Forms Discount Code Field: Apply Fixed or Percentage Discounts in a Form
Learn how to create a Gravity Forms discount code field that applies fixed or percentage discounts. This tutorial shows how to calculate subtotals, discount amounts, and final totals using tested form logic.
Gravity Forms Zoom Integration: Create Zoom Meetings From Booking Forms
Learn how to connect Gravity Forms to Zoom without Zapier using GravityWP API Connector. This step-by-step tutorial shows how to create Zoom meetings from booking form submissions and save the returned meeting details back to Gravity Forms.
Gravity Forms monday.com Integration: Create New Items From Form Submissions
Learn how to connect Gravity Forms to monday.com without Zapier using GravityWP API Connector. This step-by-step tutorial shows how to create new monday.com items from form submissions and save the returned monday.com item ID back to Gravity Forms.
Gravity Forms Pipedrive Integration: Send Form Contacts to Pipedrive Without Zapier
Learn how to connect Gravity Forms to Pipedrive without Zapier using GravityWP API Connector. This step-by-step tutorial shows how to send form contacts, custom fields, and the returned Pipedrive Person ID directly from WordPress to Pipedrive CRM.