☰
Documentation

gwp_append

With theΒ gwp_append Merge Tag Modifier for Gravity Forms you can append a string before and/or after the field value, but only if the field value is not empty.

:gwp_append before="" after=""

If you want to change the output of a Merge Tag text, use the Modifier like this:

ExampleModifierOutputInfo
{Example:1} WPValue of the field is ‘WP’
{Example:1:gwp_append before="Gravity" after=" is great"} :gwp_append before="Gravity" after=" is great"GravityWP is greatModifier adds ‘Gravity’ before and ‘ is great’ after the value ‘WP’
{Example:2} (empty field value)Value is empty
{Example:2:gwp_append before="Gravity" after=" is great"}:gwp_append before="Gravity" after=" is great"Modifier doesn’t append, because the value is empty
Examples of possible output. An empty cell means no output.

Use other field values in before and after

The before and after text can contain nested merge tags: write the merge tag with *| and |* instead of curly brackets.

{Street:3:gwp_append before="*|City:4|*, "}

Try the demo

1Input
2Output

Check also the tutorial Append text before or after Gravity Forms Merge Tag if not empty.

Frequently Asked Questions

What does the gwp_append modifier do?

The gwp_append modifier allows you to add custom text before and/or after the value of a field in Gravity Forms. This text will only appear if the field has a value. If the field is empty, no output is shown. You can use this modifier in confirmation messages, notification emails, or any other place where merge tags are supported. Example: {First Name:1:gwp_append before="Hello " after=", welcome!"} If the user enters: Jon The output will be: Hello Jon, welcome!

What happens if the field is empty?

If the field is empty, gwp_append does not display anything neither the before nor after text will be shown. Example: {Company:2:gwp_append before="Company: " after=" Ltd."} If Company is empty β†’ no output.

Can I use only before or only after?

Yes, you can use only before=”…”, only after=”…”, or both together. Example only after: {Age:3:gwp_append after=" years old"} If user enters 25 β†’ shows: 25 years old

Can I use special characters or emojis with gwp_append?

Yes. You can include special characters, punctuation, or emojis in the before or after text. Example: {Name:1:gwp_append before="πŸŽ‰ " after=" is awesome! πŸš€"} If user enters Jon β†’ shows: πŸŽ‰ Jon is awesome! πŸš€

Where can I use gwp_append?

You can use it in any part of Gravity Forms that supports merge tags, such as: -Confirmation messages -Notification emails -HTML fields in forms or pages GravityView templates (if merge tags are supported there) Example in a confirmation message: {First Name:1:gwp_append before="Hello " after=", welcome to our site!"} First Name = Field label 1 = Field ID gwp_append = merge tag modifier

Use other field values in before and after Try the demo Frequently Asked Questions
Proudly powered by WordPress