[Documentation](https://groundhogg.io/documentation/) » [Classes](https://groundhogg.io/documentation/#doc-classes)

# \Groundhogg\Submission

Published Tuesday, June 9, 2026 · Last updated Tuesday, June 9, 2026

extends `Base_Object_With_Meta`

Represents a single form submission record. Every time a Groundhogg form is submitted, a `Submission` object is created and stored. It holds the form answers, the associated contact, and the step (form) that was submitted.

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| `get_form_id()` | `int` | Returns the ID of the form (step) that was submitted. |
| `get_step_id()` | `int` | Returns the step ID (same as `get_form_id()`). |
| `get_contact_id()` | `int` | Returns the ID of the contact who submitted the form. |
| `get_contact()` | `Contact` | Returns the `Contact` object. |
| `get_date_created()` | `string` | Returns the submission date as a MySQL datetime string. |
| `get_answers( $include_hidden = false )` | `array` | Returns an associative array of field name → value pairs. Pass `true` to include hidden fields. |
| `add_posted_data( $array )` | `bool` | Adds raw posted field data to the submission record. |
| `get_as_array()` | `array` | Returns a serialisable representation of the submission. |

## Usage

Here’s a pseudo code example for a hypothetical form submission data export integration.

```

<?php

add_action( 'groundhogg/form/v2/submit', 'my_plugin_forward_submission', 10, 3 );

/**
 * Forward form answers to an external service when a specific form is submitted.
 *
 * @param \Groundhogg\Submission $submission
 * @param \Groundhogg\Form_v2    $form
 * @param \Groundhogg\Contact    $contact
 *
 * @return void
 */
function my_plugin_forward_submission( $submission, $form, $contact ) {

    if ( $submission->get_form_id() !== MY_PLUGIN_TARGET_FORM_ID ) {
        return;
    }

    $answers = $submission->get_answers();

    wp_remote_post( MY_PLUGIN_WEBHOOK_URL, [
        'body' => array_merge( $answers, [
            'contact_email' => $contact->get_email(),
            'submitted_at'  => $submission->get_date_created(),
        ] ),
    ] );
}
```
