Do you want to return a portion of a Merge Tag string output? And specify an offset and length of the part of the Merge Tag output? With Advanced Merge Tags it’s as easy as it gets.
Using the gwp_substring Modifier for Gravity Forms
With the gwp_substring Modifier for Gravity Forms Merge Tags it’s possible to return a part of value (a substring of the original string). You can use the modifier like this:
:gwp_substring start= length=
The modifier has two arguments:
- start: how many characters should it skip when using a positive value / where does the substring start. When using a negative value (for example -3), the substring will start the number of characters before the end of the value.
- length: how many characters should be in the substring / what is the length of the substring.
Try it yourself
Example gwp_substring
This example gives back a substring of the value in the Gravity Forms field ‘String’ (with Field ID 1). It skips the first two characters and gives back 3 characters:
{String:1:gwp_substring start=2 length=3}
Offset from the end of the string
When using a negative value for the start of the substring (for example start=-3), the substring will start 3 characters before the end of the value (string).
{String:1:gwp_substring start=-3 length=1}
Examples offset and length
| s | u | b | s | t | r | i | n | g |
|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| Merge Tag & Modifier | Output |
|---|---|
{String:1} | substring |
{String:1:gwp_substring length=3} | sub |
{String:1:gwp_substring start=3 length=3} | str |
{String:1:gwp_substring start=-3} | ing |
{String:1:gwp_substring start=-3 length=1} | i |
Our Premium add-ons for Gravity Forms
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.
Advanced Merge Tags
This Gravity Forms Add-On adds extra Merge Tag modifiers (and a lot of power). From the most common used functions like capitalize and length to changing date formats.
All Entries
All your new Gravity Forms entries in one central place. Stop navigating between multiple forms to find new entries. Get immediate oversight and full control with a powerful, unified dashboard.
Read tutorials about
How to Create a Public Submission Business Directory in WordPress (Gravity Forms + GravityView)
Build a moderated business directory where users submit listings through a form, admins approve entries, and approved businesses appear in a searchable GravityView directory.
How to Create an Event Workshop Registration + Waitlist System in WordPress
This guide shows how to set up a workshop registration + waitlist system in WordPress: register attendees until capacity is reached, waitlist the rest, approve entries, and auto-promote people when a seat opens using Gravity Forms, Gravity Flow, and GravityView.
Gravity Flow Form Submission Step Tutorial
The Gravity Flow Form Submission step pauses a workflow until another form is submitted, then continues once the handoff is complete. This guide shows how to connect two forms, prefill fields with mapping, send the correct secure link, and troubleshoot the most common “workflow didn’t move” issues.
Gravity Flow Delete an Entry Step Tutorial
The Gravity Flow Delete Entry step lets you trash or permanently remove Gravity Forms entries as part of a workflow. This guide covers the key settings, scheduling options (delay or date-based), and safe testing tips so you can follow retention and privacy rules with confidence.