Gravity Forms Partial Entries Exporting Entries – WordPress Tutorial


About The Author
Cabe Nolan is the founder of WP Cover where he shares his insight into WordPress, development, & entrepreneurship. Outside of WPCover, Cabe continues to run a successful WordPress development firm, Bold City Design as well as a few high profile websites, Arrivala, Two Way Resume, Dock Skipper, and a successful outdoors brand, DolfinPack.







Gravity Forms Partial Entries Exporting Entries – WordPress Tutorial

Last week I wrote an introduction post on Gravity Forms Partial Entries.  Since then I have worked further with the client on tweaking this functionality for their needs.  I mentioned in that previous article that there was not much you could do with the partial entries as far as automatically sending them to a third party and that is still true.  What I didn’t realize, is there’s not even a good way to export partial form submissions in CSV form to manually import them into a third party.  Well, my client really needed this functionality so I developed a bit of a work around.

First, I added a new hidden field to the form in question called “Form Submission Complete”.  Next, I added the following function to my themes function.php file:


// Gravity Forms Pre-Submission function for use with Partial Entries
add_action( 'gform_pre_submission', 'pre_submission_contact_page_handler' );
function pre_submission_contact_page_handler( $form ) {
$_POST['input_23'] = 'Form Submitted';
}

What the above does is hooks into Gravity Forms post submission validation and adds the value “Form Submitted” to this new hidden input field I created which happens to be input number 23.  Note that the initial add action of ‘gform_pre_submission’ will cause this functionality to be added to every Gravity Forms form.  If you want it only added to the single form, you can use gform_pre_submission_3 where the 3 is the ID of the Gravity Form.

Now I can go export my entries by following the below steps:

1. Go to Forms –> Import/Export from the left WordPress menu.
2. In the select a form box, select the form that you have enabled partial entries on
3. Select whichever fields you would like to export.  Not all are going to always be populated since these are partial submissions.
4. At the bottom where it says Conditional Login, click Add a condition and make it say “Form Submission Complete is ____________”, meaning leave the third box empty with no text.  What happens is when a form is completely submitted, the Form Submission Complete field gets populated with the text “Form Submitted” per our function above.  Therefore, exporting all entries where that field is empty, returns the partial submissions.
5. Click Download Export File

Screen Shot 2016-04-19 at 11.19.41 AM


Share Your Thoughts

Leave a Reply

Your email address will not be published.


Related Stuff You Might Like







WordPress News, Tips, & Code Snippets

Join the WP Cover mailing list and get wordpress news, tips, code snippets, security warnings, and more delivered right to your inbox.  We won't flood your inbox, newsletters typically go out every 1-2 weeks unless it involves an important security release.

You have Successfully Subscribed!