Exporting GP Nested Forms entries with GravityExport
GP Nested Forms (Gravity Wiz) saves each child entry in the child form, and the parent entry’s Nested Form field lists the IDs of its child entries. When you export the parent form with GravityExport, each child entry comes out next to the parent entry it belongs to, and child entries whose parent form was never submitted are left out.
The examples below use a workshop registration form. Its Nested Form field, Attendees, adds one entry per attendee to a separate Attendees form.
Export the child entries from the parent form #
Export filters and multi-row splitting need the full version of GravityExport.
- Go to Forms, hover over the parent form, and click Settings.
- Click GravityExport Filters, then Add New.
- On the Export Settings tab, enter a Feed Title.
- On the Enabled Fields tab, check that the Nested Form field is under Enabled Fields. A new export filter starts with every field enabled.

- On the Multiple Rows tab, choose Yes, split fields with multiple values into multiple rows.

- Click Save Settings, then download the file from the Download URL on the Export Settings tab.
GravityExport Filters explains the rest of the filter’s settings.
What the export looks like #
Each child entry gets its own row. The parent entry’s own columns are filled on its first row, and its other rows leave them empty. A parent entry with no child entries takes one row with empty child columns.
| Entry Id | Company | Name (Attendees) | Email (Attendees) |
|---|---|---|---|
| 29123 | Brightwater Studio | Priya Raman | priya.raman@brightwater-studio.com |
| Marcus Hale | marcus.hale@brightwater-studio.com | ||
| 29125 | Kestrel Works | Tomás Ortega | tomas.ortega@kestrelworks.net |
| 29126 | Northfield Library |
The child columns are named after the child form’s field, followed by the Nested Form field’s label in parentheses.
With Don’t split into multiple rows, each parent entry takes a single row. Its child entries then share each child cell, with a line of three hyphens (---) between them. GravityExport Lite exports a Nested Form field this way too.
Choose the child columns #
The child columns are the fields chosen in the Nested Form field’s Summary Fields setting, the same fields the parent form shows in its table of child entries. To change them, edit the parent form, click the Nested Form field, and choose the fields under Summary Fields.

To export more child fields without adding them to the form’s table, add them with the gk/gravityexport/field/nested-form/export-field filter. In this snippet, replace 12 with the parent form’s ID, 3 with the Nested Form field’s ID, and 4 with the ID of the child form field to add:
<?php
/**
* Adds child form fields to a Nested Form field's columns in GravityExport.
*
* @param array $field_ids IDs of the child form fields to export. Starts with the Summary Fields.
*
* @return array The field IDs to export.
*/
add_filter( 'gk/gravityexport/field/nested-form/export-field_12_3', function ( $field_ids ) {
$field_ids[] = '4'; // A field of the child form.
$field_ids[] = 'id'; // The child entry's ID.
return $field_ids;
} );Note: To add this code to your site, see Adding custom PHP code snippets to your website.
The added columns follow the order of the child form’s fields, and entry details such as the child entry’s ID come after them. The Forms list shows each form’s ID in its ID column, and the form editor shows a field’s ID at the top of its Field Settings.
Child entries whose parent was never submitted #
GP Nested Forms saves a child entry as soon as someone adds it in the Nested Form field, before the parent form is submitted. Until then, the child entry’s Parent Entry ID holds a code from the visitor’s session, such as a1250e5ba700.
When the parent form is submitted, GP Nested Forms replaces the code with the parent entry’s ID. A child entry whose parent form is never submitted keeps the code, and Gravity Wiz calls it an orphaned entry.
An export of the parent form leaves orphaned entries out, because no submitted parent entry lists them. An export of the child form includes them, with the code in GP Nested Forms’ Parent Entry ID field.
When GravityView is active, the export’s field list has two fields named Parent Entry ID. GP Nested Forms’ one is listed next to Parent Entry Form ID and Child Form Field ID.
On the child form, an export filter can’t leave them out: its Parent Entry ID condition offers is, is not, is empty and is not empty, and none of them tells a code from an entry ID.
GP Nested Forms sets an orphaned entry’s expiry date each time the entry is saved in the Nested Form field, when someone adds it and when someone edits it there. The date is one week after that save. Once a day, GP Nested Forms moves expired entries to the trash, and GravityExport leaves entries in the trash out of its exports.
The daily move runs as a WordPress scheduled task, so on a site where scheduled tasks don’t run, expired entries stay in the child form.
Gravity Wiz’s gpnf_expiration_modifier filter sets a different length of time in place of the week. It takes effect at an entry’s next save in the Nested Form field, so an orphaned entry that nobody saves again keeps the date it already has.