☰
Documentation

Combine regular with advanced modifiers

There are situations where you need to apply multiple modifiers to achieve the desired outcome. Advanced Merge Tags has a very powerful feature to execute multiple nested modifiers in a certain order. However this is only possible when the first modifier is an Advanced Merge Tags modifier.

Sometimes you want to apply a default Gravity Forms modifier like :value before applying the Advanced Merge Tags modifier.

To achieve this you can add the standard Gravity Forms modifier after the Advanced modifier like this:

{Dropdown Select:1:gwp_substring start=-4}
{Dropdown Select:1:gwp_substring:value start=-4}

In the above example, the Paragraph field contains two merge tags with the gwp_substring modifier. The first merge tag {Dropdown Select:1:gwp_substring start=-4} extracts the last 4 characters of the dropdown select label text, while the second merge tag {Dropdown Select:1:gwp_substring:value start=-4} extracts the last 4 characters of the dropdown select value text.

You can use other regular Gravity Forms field modifiers in combination with the gwp_substring modifier, as well as other gwp_* modifiers provided by GravityWP – Advanced Merge Tags. The possibilities are almost endless, and you can use these modifiers to customize your form data in various ways.

How it works

  • Write the regular modifier directly after the advanced modifier name, separated by a colon, and put the advanced modifier’s options after it: {Field:1:gwp_case:value to=upper}.
  • The regular modifier is applied first, then the advanced modifier works on that result.
  • Supported are the regular modifiers of the field type, like :value for choice fields, :label (the field label instead of the value; :label,admin for the admin label), :numeric (a number without formatting), :qty (the quantity of a product field) and :urlencode. Separate several regular modifiers with a comma.
  • This also works with gwp_eeid: {gwp_eeid:3:gwp_case:value to=upper}.
  • To apply more advanced or regular modifiers after the first advanced modifier, use nested modifiers.

Modifiers in calculations

When merge tags are used in calculations the fields value is used by default. Some Advanced Merge Tags modifiers are available in calculations, for example gwp_substring and gwp_word_count. These advanced modifiers are being applied to the fields (raw) value. Combining regular modifiers with advanced modifiers in calculations is not (yet) supported. Both modifiers also work in calculated List field columns made with the GravityWP List Number Format add-on; see gwp_substring and gwp_word_count.

How it works Modifiers in calculations
Proudly powered by WordPress