You are viewing beta documentation for Formie 4.x.
Reference

Submission

A Submission object represents data that has been saved through a form. That can be a completed submission, a partially saved submission, or a submission that has been marked as spam.

Properties

id

Type: int|null

The submission ID.

formId

Type: int|null

The form ID this submission belongs to.

form

Type: verbb\formie\elements\Form|null

The Form this submission belongs to.

statusId

Type: int|null

The submission status ID.

status

Type: string|null

The submission status handle.

userId

Type: int|null

The user ID associated with the submission, when collected.

user

Type: craft\elements\User|null

The Craft user associated with the submission, when collected.

siteId

Type: int|null

The site ID this submission was made on.

snapshot

Type: array

The saved render snapshot used for field settings and submission output.

ipAddress

Type: string|null

The submitter IP address, when collected.

isIncomplete

Type: bool

Whether the submission is incomplete.

isSpam

Type: bool

Whether the submission has been marked as spam.

spamReason

Type: string|null

The spam reason, when the submission is marked as spam.

validateCurrentPageOnly

Type: bool|null

Whether validation should only run for the current page.

dateCreated

Type: DateTime|null

The date the submission was created.

Methods

getForm()

Returns: verbb\formie\elements\Form|null

Returns the submission’s Form.

getPages()

Returns: array

Returns the form pages for this submission.

getRows()

Returns: array

Returns the form rows for this submission.

getFields()

Returns: array

Returns the form fields for this submission.

getFieldByHandle()

Returns: verbb\formie\base\FieldInterface|null

Returns a field by handle.

setFieldValue()

Returns: void

Sets a field value on the submission.

getFieldValue()

Returns: mixed

Returns only the normalised runtime value for the supplied field key. It takes no projection argument. Text, Email and Phone return strings; Name always returns a NameFieldValue; dates, selected options and relation queries retain their domain semantics.

getFieldValueAsString()

Returns: mixed

Returns the field value as a string.

getFieldValueAsData()

Returns: mixed

Returns the natural JSON-safe field value. Primitive fields return scalars; structured fields return explicit named data.

getFieldValueForReference()

Returns: mixed

Returns the field value prepared for singular reference contexts.

getFieldValueForReferenceBlock()

Returns: mixed

Returns the field value prepared for reference-block rendering.

getFieldValueForExport()

Returns: mixed

Returns the field value prepared for export.

getFieldValueForSummary()

Returns: mixed

Returns the field value prepared for summary views.

getFieldValueForIntegration()

Returns: mixed

Returns the field value prepared for an integration field.

getValuesAsString()

Returns: array

Returns all submitted field values as strings.

getValuesAsData()

Returns: array

Returns a handle-keyed map of natural JSON-safe field data. Individual values may be scalars, null or structured arrays.

getValuesForExport()

Returns: array

Returns all submitted field values prepared for export.

getValuesForSummary()

Returns: array

Returns all submitted field values prepared for summary views.

getRelations()

Returns: array

Returns element relations found in the submission.

getPayments()

Returns: array|null

Returns payment records associated with the submission.

getSubscriptions()

Returns: array|null

Returns subscription records associated with the submission.