Documentation

gwp_substring

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.

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}
Advanced Merge Tagsv1.2.2

To use the functionalities described in this documentation, you'll need to get the GravityWP - Advanced Merge Tags add-on.

Read more

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close