Skip to main content

Modifier :count

:count does different things on different tags and fields:

  • Number of repeated items on Repeater fields, under What to show in the picker.
    Example: {Line Items:137:count} gives 2. On the test form, this field is {Line Items:137} (Repeater).
  • Count on Single line text, Paragraph text, Drop down, Multi select, Number, Radio buttons, Hidden, Date, Time, Phone, standard format, Website, Email, File upload, List, Image choice, Multiple choice, Product, Quantity, Option, Shipping, Total, Calculation, post_title, post_content, post_excerpt, post_tags, Post category, Post image, and post_custom_field fields, under What to show in the picker.

Number of repeated items

Other repeater modifiers are ignored.

ProductGravity Forms
RequiresGravity Forms 3.0.0 or later
In the pickerWhat to show, for Repeater fields

Examples

Output from the real plugin code, run on a test entry.

Merge tagOutputWithout the modifier
{Items:17:count}2HTMLItem Name Widget Quantity 3 Size Large Item Name Gadget Quantity 1 Size Large

Works on

Form fields: Repeater.

Count

The number of entries. With scope="form", only entries with a value in this field.

ProductGravityMath
RequiresGravityMath 1.0 or later
In the pickerWhat to show, for Single line text, Paragraph text, Drop down, Multi select, Number, Radio buttons, Hidden, Date, Time, Phone, standard format, Website, Email, File upload, List, Image choice, Multiple choice, Product, Quantity, Option, Shipping, Total, Calculation, post_title, post_content, post_excerpt, post_tags, Post category, Post image, and post_custom_field fields
CombiningUse it alone. With other modifiers, it is ignored.

Examples

Output from the real plugin code, run on a test entry.

Merge tagOutputWithout the modifier
{Amount:8:count}2$1,234.56

Works on

The merge tag picker does not offer it anywhere.

Left out

Field kindsWhy
Single line text · Paragraph text · Email · Website · Hidden · Drop down · Radio buttons · Multi select · Image choice · Multiple choice · Post category · Number · Product · Quantity · Option · Shipping · Total · Date · Date, after a custom format · Time · Phone, standard format · Phone, international format · File upload · Post image · ListWorks only inside a shortcode. GravityMath adds this up across entries, which it does only between the tags of its [gvmath] shortcode.
CalculationOutputs nothing on the whole field. Gravity Forms has no single value for this field as a whole, so the tag outputs nothing and so does any modifier. Use one part instead, like .3 for a first name.