How to combine and display data from multiple forms

How to combine and display data from multiple Gravity Forms

Written by Casey Burridge

Last updated:

Categories GravityView

Tags ,

So you’re using Gravity Forms to collect data and now you need a way to connect two or more forms and combine the data together?

In this post, we’ll show you how to:

  • Connect two or more Gravity Forms
  • Insert data from multiple forms into a table
  • Add data from multiple forms into one report

All of this is possible using GravityView and our Multiple Forms Extension. Multiple Forms allows you to combine data from forms with common field values into one long entry and display or export that information.

This is a game-changer for sites that need to aggregate data from multiple sources. Keep reading to find out more!

Sneak peek

In this tutorial, we’ll combine information from two separate forms in Gravity Forms to create one, long entry. As you can see, we’ll then show you how to display and export that data using GravityView.

A table containing Data from two different forms in Gravity Forms

Let’s get started.

What you’ll need

Here’s what you’ll need for this tutorial.

Why display data from multiple forms in one View?

There are several reasons why you may wish to display data from multiple forms in a single View.

Combining data from multiple sources is useful if you have a website or app that collects information across two or more forms. Here are some examples:

  • You run a doctor’s practice and you have one form for collecting patient contact details and another form for inputting patient health information. Now you want to combine that data into a single table.
  • You’re hosting a professional network and each member fills in two forms—one for personal details and another one for their business details. Now you want to combine that into a single profile.
  • You run a nonprofit organization and you have two separate forms. One for collecting member details and another for donations.

Let’s take a look at the Multiple Forms Extension in a little more detail.

Introducing the GravityView Multiple Forms Extension

Multiple Forms is an extension for GravityView, our flagship Gravity Forms add-on that allows you to display form data on the front end of your website. With the Multiple Forms Extension, you’re no longer limited to just displaying data from one single form; you can combine data from two or more forms for displaying or reporting purposes.

The GravityView Multiple Forms extension plugin image

The Multiple Forms Extension is still in beta, which means we’re working hard to add new features and improve functionality!

How does it work?

Multiple Forms allows you to combine data from two or more Gravity Forms that share a common field to create one, long entry. This works like an SQL join operation.

💡 Pro tip: SQL stands for Structured Query Language. It’s used for retrieving data from a database.

There are four ways to join data together from multiple tables in SQL:

  • Left Join – Display all data from form #1, regardless of whether the fields in form #2 have content (supported).
  • Right Join –  Display all data from form #2, regardless of whether the fields in form #1 have content (not supported).
  • Inner Join – Only display entries from form #1 that have values in form #2 (supported).
  • Full Join – Display all the entries from both forms (not supported).

The below graphic clarifies how these join operations work.

A graphic depicting the difference between SQL left join, right join, inner join and full join.

It’s important to know that the Multiple Forms Extension supports both left joins and inner joins. We’ll show you how to use both in this tutorial.

Installing the GravityView Multiple Forms Extension

If you already have GravityView installed, you can install the Multiple Forms Extension from inside WordPress. First, hover over “GravityKit” and click “Manage Your Kit”. Now scroll down to Multiple Forms and click “Install”.

The 'Multiple Forms' plugin card on the Manage Your Kit page in WordPress

Displaying data from multiple forms in a single View

In this example, we have two forms that collect information from clients. The first form (“Client details”) collects the client’s name, email address, phone number, address and the date they joined.

The second form (“Client feedback”) collects feedback from the client in the form of a rating and a short text review.

Two forms in Gravity Forms, one called 'Client details' and another called 'Client feedback'

Our goal is to join these forms together, creating one, long entry and then insert that data into a single table using GravityView.

Creating the View

To create a new View, we’ll hover over “GravityKit” and click “New View”. After giving our View a name, we’ll select our first form as the data source.

Selecting a data source in GravityView

Next, we’ll need to select a View Type, i.e., a layout template for displaying data on the front end. GravityView supports 5 layout types in total—”Table”, “List”, “DataTables”, “DIY” and “Maps”.

The different View Types in GravityView

After selecting a View layout, we can start adding fields to the View editor.

Adding join conditions

A join condition allows you to pull data from two or more forms. To add a second form, we’ll scroll down to the Data Source meta box and click ‘Add Join Condition’.

A button that says 'Add Join Condition'

Now we need to select the form fields to join on. The fields we select need to share common values, otherwise it won’t be possible to join the two forms!

In this example, we’ll join the forms using the “Email” field. What does this mean? In short, GravityView will check the “Client details” and “Client feedback” forms and when it finds two entries with the same value in the “Email” field, it wil join them together into a single entry.

The GravityView Data Source meta box

💡 Pro tip: If you want to join data from more than two forms, simply click the ‘Add Join Condition’ button again and add a new join operation.

After adding our join conditions, we have the ability to add fields from both forms inside the View editor. As you can see, there are two buttons for adding fields from each of the two forms that we joined!

Buttons in the GravityView View editor allowing you to add fields from multiple forms

It might have occured to you that one form may have more entries than another, or one form may include an entry for which there is no match in the second form. In this scenario, GravityView will display entries as usual, even if some fields are blank due to missing data.

If you don’t want to show any blank fields, you can change the way GravityView processes the data by enabling strict entry matching.

Enabling strict entry matching

If you scroll down to the View Settings, you’ll see an option labeled “Strict Entry Match”. If you enable this setting, your View will only return entries that contain values from both forms.

A checkbox in the View Settings that says 'Strict Entry Match'

In other words, enabling “Strict Entry Match” will combine data using an inner join instead of the default left join.

Checking it out on the front end

When you’re finished configuring your View layout, open it up on the front end. As you can see, each entry contains data from both of our forms.

A table containing Data from two different forms in Gravity Forms

That’s it!

Exporting data from multiple forms

If you want to export data from multiple forms and create reports, you can use the GravityView DataTables View Type and enable the export buttons functionality. DataTables allows you to export data in a View to CSV, Excel or PDF!

The DataTables settings in GravityView

💡 Pro tip: You can trial GravityView and the Multiple Forms Extension by signing up for your own, free demo site!

Display data from multiple forms

If you collect data from multiple Gravity Forms, it can be helpful to combine that information into a single entry and display it using GravityView.

In this post, we showed you how to combine data from two or more forms in Gravity Forms and display it on the front end of your website using Multiple Forms. The Multiple Forms Extension for GravityView is a game-changer when it comes to aggregating data from multiple sources.

If you enjoyed this post, read more content on our blog.

Helpful tips right in your inbox.

Subscribe to our biweekly newsletter for tips, special offers, and more!

Helpful tips right in your inbox.

Subscribe to our biweekly newsletter for tips, special offers, and more!