Documentation

gwp_sum_matched_entries_values

The gwp_sum_matched_entries_values Modifier can be used to calculate the sum of a field value in multiple entries of a certain form (the same or another), based on a shared value with optional extra filters.

:gwp_sum_matched_entries_values form_id= match_id= return_id= filter1= operator1= value1= filter2= operator2= value2=

The minimum requirements when using the Modifier are:

  • form_id: ID of the Form with the entries you want to calculate the sum of.
  • match_id: ID of the Field within that Form you want to match the value of the Merge Tag’s field value to.
  • return_id: ID of the Field that you want to get the sum of the values of.

Optionally you can add one or more filters to only calculate the sum of the filtered entries. Supported operators are: ‘is’, ‘isnot’, ‘contains’, ‘greater_than’, ‘less_than’, ‘greater_than_or_is’, ‘less_than_or_is’.

Examples

{PROJECT_ID:21:gwp_sum_matched_entries_values form_id=19 match_id=8 return_id=11}

{Textfield:1:gwp_sum_matched_entries_values form_id=2 match_id=1 return_id=5 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}. The total sum of Field 5 is returned, but only entries where the Field 3 value is ‘complete’ AND where created_by is the User with user-id 1.

{PROJECT_ID:21:gwp_sum_matched_entries_values form_id=19 match_id=8 return_id=11}

Finds all entries where Field 8 in Form 19 has the same value as {PROJECT_ID:21}. The total sum of the values in Field 11 of the matching entries in Form 19 is returned.

Frequently Asked Questions

What does the gwp_sum_matched_entries_values merge tag do?

This modifier sums up values from a numeric field across multiple entries in another Gravity Form (or the same one). It matches entries based on a shared value (like a product ID or user ID), and optionally applies filters like status or user role.

Example:
{Product SKU:1:gwp_sum_matched_entries_values form_id="52" match_id="1" return_id="3"}

This sums the Quantity field (ID 3) in Form 52 where Ordered SKU (ID 1) matches the current entry’s Product SKU (ID 1).

How do form_id, match_id, and return_id work?

These three parameters are required:

-form_id: The form that holds the entries to be queried.
-match_id: A field in that form whose value must match the current field’s value.
-return_id: The field whose numeric values should be summed.

Example:
{User ID:2:gwp_sum_matched_entries_values form_id="45" match_id="7" return_id="10"}

This will total the values from Field 10 in Form 45 for all entries where Field 7 matches the current User ID.

Can I filter the entries before summing?

Yes. You can filter results using filterX, operatorX, and valueX (e.g., filter1=4 operator1=is value1=completed). This allows you to sum only entries that meet specific conditions like those marked “completed” or submitted by a certain user.
You can also use nested merge tags inside the value fields for dynamic filtering.

Example:
{Product SKU:1:gwp_sum_matched_entries_values form_id="52" match_id="1" return_id="3" filter1="4" operator1="is" value1="completed"}

This adds up the Quantity (Field 3) for entries where Status (Field 4) is “completed.”

Why am I getting ## access not allowed ##?

This happens when the target form’s Advanced Merge Tags settings block access to entry values. By default, querying data from other form entries is blocked, because it might allow users to reveal sensitive data if they can freely influence the match criteria.
To allow this, go to the target form and:

→ Go to Settings > Advanced Merge Tags
→ Under Entry Access, select “Everyone” or “Logged in users”
→ Click Save Settings

Once updated, the modifier will be able to retrieve and display the total.

Last updated: 22-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