BrightLeaf Digital Code Snippet Library

Check out our growing library of code snippets for Gravity Forms!

Export Form Layout to Google Doc

Goal

Adds an "Export Layout" button to the Gravity Forms editor that copies a full HTML visual layout of the form to the clipboard, ready to paste straight into a Google Doc. Useful for handing a form's structure to someone who does not have admin access, and for keeping a readable record of how a form was built.

Requirements

  • Gravity Forms, and the gravityforms_edit_forms capability.
  • Gravity Perks Populate Anything, for the GPPA section of the export. The rest of the layout exports without it.

Usage

Open a form in the editor and click Export Layout, then paste into the target document.

Features

The exported layout carries the field metadata the editor does not show at a glance:

  • Every field and sub-field, with its label, type and visibility.
  • Conditional logic, with field IDs resolved back to their labels.
  • Calculation formulas.
  • Populate Anything (GPPA) choice and value configuration, including the source object type, the primary property, and the ordering property and direction.

Notes

  • The AJAX endpoint that supplies the field data is nonce-checked and requires gravityforms_edit_forms, so it is not readable by unprivileged users.
Install Using Code Snippets

This code is best installed directly on your site using the Code Snippets plugin.

Check Out the Code

Loading...

Code Copied!
Stay Updated On This Snippet

This entry has no reviews.