Front-End & Daily

Workaround for the issue where using CF7 Multi-Step Forms and Google Sheets Connector together adds duplicate entries to the spreadsheet

Workaround for the issue where using CF7 Multi-Step Forms and Google Sheets Connector together adds duplicate entries to the spreadsheet

Regarding the Wordpress contact form plugin Contact Form 7,

When using the plugin "Contact Form 7 Multi-Step Forms" which allows adding a confirmation screen, and
"CF7 Google Sheets Connector" which summarizes submission content into a spreadsheet,

We will introduce a workaround for the phenomenon where the same content is sent to the spreadsheet twice, once when transitioning to the confirmation screen and once upon submission.

Please note that this is merely a temporary fix, as a fundamental solution has not been found.

Table of Contents

Workaround

For the phenomenon where data is sent twice, once for the confirmation screen and once for submission, we will temporarily give up on a direct fix.

Instead, we will ensure that the button text is entered into the "submit" column only upon submission,

When using Contact Form 7 Multi-Step Forms and CF7 Google Sheets Connector together, two entries are registered in the spreadsheet

(In this example, row 5 should be adopted)

By applying a filter to the "submit" column, you can display only the submitted information.

Filter using Google Sheets

We will proceed with this approach.

Steps

You don't need to do anything special with the confirmation button on the input form.

<input type="submit" value="Confirm">

The goal is to set some `name` attribute for the submit button on the confirmation screen.

<input type="submit" name="submit" value="Send">

First, assign an `id` or `class` to the submit button from the Contact Form 7 editing screen.

[submit id:submit "Send"]

Make the confirmation screen form look like this.

WordPress Contact Form 7 Admin Screen

This will output as follows,

<input type="submit" id="submit" value="Send">

Set the `name` attribute of the submit button with JS.

$("#submit").attr("name", "submit"); //Set the name attribute of the submit button to "submit"
/* == or == */
document.getElementById("submit").setAttribute("name", "submit"); //This is how you'd do it with vanilla JavaScript

With this, the "submit" information will only be sent upon submission.

Next, create a "submit" column in the spreadsheet (match it with the `name` attribute value).

Create a submit column in the spreadsheet

The information will be entered like this,

Spreadsheet

Then, apply a filter to the "submit" column, and you're done.

Spreadsheet Filter

What was happening

When "Contact Form 7 Multi-Step Forms" and "CF7 Google Sheets Connector" are used together,

At the timing of transitioning to the confirmation screen,

WordPress Contact Form 7

and at the timing of submission, information is sent to the spreadsheet,

WordPress Contact Form 7 Confirmation Screen

resulting in the same information being sent to the spreadsheet twice.

Two identical entries appear in the spreadsheet

It would be a nightmare if users repeatedly moved back and forth between the confirmation screen...

It's not certain, but it seems that according to the specifications of "CF7 Google Sheets Connector", information is sent to the spreadsheet when type="submit" is pressed,

and since both the button to transition to the confirmation screen and the submit button are type="submit", I believe the information is sent twice.

Comments

After reviewing the content, we will publish it, omitting any personal information.

Enter your name and email address as well

Please enter if you would like a reply by email.

We will not disclose any personal information received. It will only be used for replies.

It will be sent directly. Please confirm and then "Send".

If this was helpful, we appreciate your support!
All support received will be used for child-rearing.

Author's Baby Registry (Amazon)

Send support via OFUSE

Or support me by buying something from the buttons below
(You don't have to buy the specific item on the linked page.)

Support me via Amazon

Support me via Rakuten

Support me via Yahoo!Shopping

PR

As an Amazon Associate, Ken earns from qualifying purchases.

Share

Share on Twitter Share on Facebook Share on LINE Share on Hatena Bookmark