Documentation

gwp_count_matched_entries

The gwp_count_matched_entries Modifier can be used to count entries from another form, based on a shared value with optional extra filters.

:gwp_count_matched_entries form_id= match_id= filter1= operator1= value1= filter2= operator2= value2=

Supported operators: ‘is’, ‘isnot’, ‘contains’, ‘greater_than’, ‘less_than’, ‘greater_than_or_is’, ‘less_than_or_is’.

Example

{Textfield:1:gwp_count_matched_entries form_id="2" match_id='1' filter1="3" operator1="isnot" value1=complete filter2="created_by" operator2="is" value2=1}

Matches all entries in Form 2 where Field 1 has the same value as Textfield:1. It counts only entries where Field 3 value is ‘complete’ AND where created_by is User 1. The total count (sum) of matching entries is returned.

Frequently Asked Questions

How do I count entries from another form that match a specific value?

Use this modifier to count how many entries in another form match a value from the current form. You must pass that value dynamically through a field merge tag.

{Enter Order Code:1:gwp_count_matched_entries form_id="35" match_id="1"}

This counts how many entries in Form 35 have the same value in Field 1 as the user’s input in Field 1 of the current form.

Can I filter matched entries by another field like Status?

Yes. You can apply one or two filters to limit the count. Use filter1=, operator1=, and value1= to filter results further. In this example, we count only if “Status” (Field 3) equals “Completed”:

{Enter Order Code:1:gwp_count_matched_entries form_id="35" match_id="1" filter1="3" operator1="is" value1="Completed"}

Can I make the filter value dynamic too?

Yes — the modifier supports nested merge tags. You can pull the filter value from another field using this syntax: *|Field Label:ID|*. This example uses the user’s selected status as a dynamic filter:

{Enter Order Code:1:gwp_count_matched_entries form_id="35" match_id="1" filter1="3" operator1="is" value1="*|Filter Status:5|*"}

Now it only counts entries where both the Order Code and Status match the user’s input.

Why doesn’t value=”…” work directly inside the tag?

Because this is a modifier, not a standalone merge tag. Using value=”…” alone will fail. Always pass values through a proper merge tag like this:

Correct: {Order Code:1:gwp_count_matched_entries form_id="35" match_id="1"}

Wrong: {gwp_count_matched_entries form_id="35" match_id="1" value="ABC123"}

Can I use this with dropdowns or other field types?

Yes. It works with dropdowns, radio buttons, text fields, hidden fields, and more. Just make sure the field values match what’s stored in the target form:

{Favorite Color:2:gwp_count_matched_entries form_id="27" match_id="9"}

This counts how many entries in Form 27 have the same value in Field 9 as selected in the current form’s Field 2.

Last updated: 18-07-2025

Advanced Merge Tagsv1.9.3

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

Read more