Published

Updated

How to combine and display data from multiple Gravity Forms forms

Learn how to combine data from multiple Gravity Forms using joins and unions, and display everything in one searchable table with GravityView. No code required.

So you’re using Gravity Forms to collect data through two or more forms, and now you need everything in one place? In this post, we’ll show you how to combine and display data from multiple Gravity Forms using GravityView and the Multiple Forms extension, with no custom code required.

Multiple Forms gives you two ways to combine your forms’ data:

  • Joins – Match related entries from different forms and display them side by side in one row.
  • Unions – Stack entries from several forms into one combined list.

We’ll walk through both, step by step.

Sneak peek

Here are the two kinds of Views you’ll be able to build. The first is a join: each row combines an employee’s directory details with a check-in collected through a second form. It’s the exact View we’ll build in this tutorial.

A front-end table View joining an employee directory form with an employee check-ins form, with a search bar above. The three columns from the check-ins form are tinted gold
A join adds columns from a second form: the gold-tinted columns come from the joined form.

The second is a union: registrations from two forms, one for in-person attendees and one for virtual attendees, stacked into a single searchable list.

A front-end View combining in-person and virtual workshop registrations in one table, with a search bar above. Rows from the virtual registration form are tinted gold to show which form each entry came from
A union stacks entries into one list: the gold-tinted rows come from the added form.

What you’ll need

Here’s what you’ll need to follow along.

Pro tip: Unions are a newer feature. Make sure you’re running Multiple Forms 0.7.0 or newer and GravityView 3.3 or newer.

Why combine data from multiple forms?

Combining data is useful whenever your site collects related information across two or more forms. Here are some examples:

  • You run a doctor’s practice with one form for patient contact details and another for health information, and you want both in a single table
  • Your professional network asks each member to fill in a personal details form and a business details form, and you want to combine them into one profile
  • You collect event registrations through separate forms for different ticket types or locations, and you want one combined list of attendees
  • Each department has its own request form, and you want a single tracker showing every request

The first two are jobs for a join. The last two are jobs for a union. Let’s look at the difference.

Two ways to combine forms: joins and unions

Joins and unions solve different problems, so it’s worth taking a moment to pick the right one. Our joins and unions page shows each one in motion if you want to see the difference before you build anything.

  • Joins – Match related entries using a shared field, like an email address or an ID, and display them side by side in one row. Use a join when different forms hold information about the same person or thing.
  • Unions – Stack complete entries from several forms into one list, one row per entry, with no shared field required. Use a union when different forms collect the same kind of information and you want everything together.
Two labeled diagrams comparing Multiple Forms modes: a join matches two forms on a shared field and combines them into wider rows, while a union stacks entries from two forms into one combined list
Joins match related entries into one row; unions stack entries from every form into one list.

Pro tip: If you’ve worked with databases before, these behave like their SQL counterparts. A join matches rows across tables on a shared key, and a union appends rows from one table to another.

Installing the Multiple Forms extension

If you already have GravityView installed, you can install Multiple Forms from inside WordPress. Hover over GravityKit in the WordPress admin menu, click Manage Your Kit, scroll down to Multiple Forms and click Install.

The Multiple Forms card on the Manage Your Kit page, showing version 0.7.0 with links to the changelog and documentation
Multiple Forms on the Manage Your Kit screen.

Displaying data from multiple forms with a join

For the join walkthrough, we have two forms that track employees. The first form (“Employee directory”) stores each employee’s ID, name and department. The second form (“Employee check-ins”) collects status updates, with each check-in referencing an employee ID.

Our goal is a single table showing each employee’s directory details next to their check-ins.

Creating the View

To create a new View, hover over GravityKit and click New View. Give the View a name, then select the first form (“Employee directory”) as the data source.

The Add New View screen in GravityView, with a field for the View name and a Data Source box for choosing a form or form preset
Choose your primary form as the View’s data source.

GravityView displays entries using a View type, like Table, List or DataTables. You can switch View types at any time using the View type dropdown in the editor. For combined data, Table is a good starting point.

Adding a join

To bring in the second form, scroll down to the Data Source box and click + Add Merge Condition.

The Data Source box in the GravityView View editor with the Add Merge Condition button below the form selector
The Add Merge Condition button sits below the form selector.

The Merge Source panel opens with Join selected. Choose the form you want to join, then select the fields to match on. The fields need to share common values; otherwise, there’s nothing to connect the entries.

In this example, we’ll match the “Employee ID” field from each form. When GravityView finds a directory entry and a check-in with the same employee ID, it connects them into a single row.

A configured join in the Merge Source panel: Employee directory joined with Employee check-ins on the Employee ID field from each form, with an Add field button for matching on more fields
This join matches entries on the Employee ID field.

Pro tip: To join more than two forms, click + Add Join and add another join block.

Adding fields from both forms

After adding the join, the View editor shows a separate add button for each form. Add fields from either form and arrange them in any order.

The Visible Table Columns list in the View editor with fields from both forms, above two buttons: Add Field from Employee directory and Add Field from Employee check-ins
Each joined form gets its own button for adding fields.

Handling entries that don’t match

One form may have entries with no match in the other. By default, every entry from your primary form appears in the View, and any columns from the second form simply stay blank.

If you only want rows where both forms have data, scroll down to the Settings box and enable Strict Entry Match.

The Strict Entry Match checkbox in the View Settings, below the Show only approved joined entries setting
Strict Entry Match hides entries that have no match in the connected form.

Pro tip: For finer control over which entries appear, you can apply filter conditions to fields from any joined form. Read Using Advanced Filtering with Multiple Forms to learn how.

Checking it out on the front end

When you’re done configuring the View, embed it on a page or open its permalink. Each row combines directory details with a check-in, and if an entry has several matches, each match becomes its own row. Notice the last row: that employee hasn’t checked in yet, so the check-in columns are blank.

A front-end table View combining employee directory details with check-in statuses, including a search bar. One employee without check-ins shows blank check-in columns
Columns from both forms in one searchable table.

The search bar works across the joined data too. For details on how searching behaves in combined Views, read Multiple Forms: Searching entries.

Matching on more than one field

Sometimes one field isn’t enough to identify a match. Since Multiple Forms 0.7.0, a single join can match on several fields: click Add field in the join block to add another pair.

For example, this View joins a course enrollment form with an exam results form on both first name and last name, so two students named Sarah stay correctly matched to their own scores.

A join block in the Merge Source panel matching Course enrollments with Exam results on two field pairs, first name and last name, with an Add field button below
This join matches entries on first name and last name together.
A front-end table View joining a course enrollment form with an exam results form. The two columns from the exam results form are tinted gold
The result: enrollment columns on the left, exam columns (tinted) on the right.

That’s everything you need for joins. For a complete reference, including View setup and settings, read Getting Started With Multiple Forms.

Stacking entries from multiple forms with a union

Now for unions. This time we have two event registration forms, and instead of matching entries, we want every registration from both forms in one list.

Start the same way: create a View using one of the forms as the data source, then click + Add Merge Condition. This time, choose Union at the top of the Merge Source panel.

The Merge Source panel with the Union option chosen in the "How do you want to merge?" toggle and an empty union block below
Switch the merge mode from Join to Union.

Choose the form you want to combine, and a field mapping screen aligns its fields into your primary form’s columns. Fields with identical labels connect automatically. To map fields with different names, like “Full name” and “Attendee name”, click the dropdown next to the source field and pick the matching one.

The union field mapping table with source fields from the primary form on the left, automatically mapped to matching fields from the added form on the right
Fields with matching labels are mapped automatically.

Pro tip: You don’t need to map every field. If a form has no equivalent for a column, leave it unmapped and that form’s rows show an empty value there.

On the front end, the View behaves like a single data source. Entries from all forms are interleaved and sorted together, and searching works through the mapped columns. Single Entry pages work for every row, and Edit Entry uses each entry’s own form.

A front-end table View displaying combined entries from two registration forms in one table, with shared columns for name, email, company, and ticket type
Entries from both registration forms, stacked into one list.

For the full walkthrough, including how unions handle searching, sorting and editing, read Using unions in Multiple Forms.

Exporting data from multiple forms

If you want to turn your combined data into reports, use the DataTables View type and enable its export buttons. Site visitors can then download the data in the View as a CSV, Excel or PDF file.

Start combining your form data

If you collect data across multiple Gravity Forms forms, you no longer have to view it in separate pieces. Joins bring related entries together into one row, and unions stack entries from every form into one list, all displayed with GravityView.

Multiple Forms is included in GravityView Pro and All Access. Unions arrived in Multiple Forms 0.7.0 and require GravityView 3.3 or newer, so update both plugins from your Plugins page or the GravityKit Manage Your Kit screen to get started.

Want to try it first? Take Multiple Forms for a spin on our demo site, or read more about the new unions feature in our announcement post.