Submission Content
For querying submissions, field-type recipes, and common mistakes, see The complete guide to rendering submission content.
Formie returns submission content in different shapes depending on what you are doing with it.
That is why the same field can look different in a template, an export, a summary screen, an email, or an integration payload. A simple text field might come back as a plain string in one place, while an address, name, or repeater field may need a structured array in another.
To protect selected values while they are stored, see Content Encryption. It covers key setup, shared environments, encrypted fields, unavailable values, recovery and rotation.
Reading Submission Values
The Submission element gives you helper methods for the most common formats.
Get the Normal Field Value
Use getFieldValue() when you want the field's normal value without forcing a particular format.
$submission = \verbb\formie\elements\Submission::find()
->id(123)
->one();
$firstName = $submission->getFieldValue('firstName');
$billingAddress = $submission->getFieldValue('billingAddress');
// Shorthand syntax is also available for direct field access.
$firstName = $submission->firstName;{% set firstName = submission.getFieldValue('firstName') %}
{% set billingAddress = submission.getFieldValue('billingAddress') %}
{# Shorthand syntax is also available for direct field access. #}
{% set firstName = submission.firstName %}For simple fields, this is often enough. For more complex fields such as Address, Name, Group, Repeater, or Table, you will usually want one of the more explicit methods below.
Get a String Value
Use getFieldValueAsString() when you need plain text. This is useful for logs, simple output, spam tools, or anywhere you need a field collapsed into a readable string.
$fullName = $submission->getFieldValueAsString('fullName');
$message = $submission->getFieldValueAsString('message');{{ submission.getFieldValueAsString('fullName') }}
{{ submission.getFieldValueAsString('message') }}Formie also provides a method that returns string values for the whole submission when you need all non-cosmetic values in one pass.
$values = $submission->getValuesAsString();{% set values = submission.getValuesAsString() %}Get Field Data
Use getFieldValueAsData() to read a field as plain data that can be encoded as JSON. Depending on the field, the result may be a string, number, boolean, array, or null.
A text field still returns a string such as "Hello". The difference is more useful for structured fields: an Address field returns an associative array with parts such as address1, city, and zip, instead of its field value model. You can work with those parts directly or include the array in an API payload.
$name = $submission->getFieldValueAsData('fullName');
$address = $submission->getFieldValueAsData('billingAddress');{% set name = submission.getFieldValueAsData('fullName') %}
{% set address = submission.getFieldValueAsData('billingAddress') %}
{{ address.address1 }}
{{ address.city }}
{{ address.zip }}You can do the same for the whole submission.
$values = $submission->getValuesAsData();{% set values = submission.getValuesAsData() %}Get Export Values
Use getFieldValueForExport() or getValuesForExport() when the result is going into a CSV, spreadsheet, or report.
$paymentTotal = $submission->getFieldValueForExport('payment');
$exportValues = $submission->getValuesForExport();{% set paymentTotal = submission.getFieldValueForExport('payment') %}
{% set exportValues = submission.getValuesForExport() %}Export output can flatten complex fields into multiple columns. For example, an Address field may become several export columns instead of one nested array.
Get Summary Values
Use getFieldValueForSummary() or getValuesForSummary() when you are building a review screen, confirmation step, or summary output.
$summaryValue = $submission->getFieldValueForSummary('billingAddress');
$summaryItems = $submission->getValuesForSummary();
foreach ($summaryItems as $item) {
$field = $item['field'];
$html = $item['html'];
$text = $item['text'];
}{% set summaryValue = submission.getFieldValueForSummary('billingAddress') %}
{% set summaryItems = submission.getValuesForSummary() %}
{% for item in summaryItems %}
<h3>{{ item.field.name }}</h3>
{% if item.html %}
{{ item.html }}
{% else %}
{{ item.text }}
{% endif %}
{% endfor %}Summary values are designed for display, not for integrations or exports.
Work with Nested Field Paths
You can access nested values with dot notation. This is useful for Group fields, Address sub-values, and repeater rows.
$street = $submission->getFieldValue('billingAddress.address1');
$city = $submission->getFieldValue('billingAddress.locality');
$firstRepeaterEmail = $submission->getFieldValue('attendees.0.email');{{ submission.getFieldValue('billingAddress.address1') }}
{{ submission.getFieldValue('billingAddress.locality') }}
{{ submission.getFieldValue('attendees.0.email') }}This is often the simplest way to pull out one specific nested value without working with the whole structured array.
Date/Time fields also support canonical nested paths such as eventDate.date, eventDate.time, and, for date ranges, booking.startDate or booking.end. Date values stringify to canonical ISO-style text. Use getFieldValueAsString() for the field's configured date and time display formats.
Use Context-Specific Helpers
Formie also includes helpers for values that are being prepared for a specific system or job:
getFieldValueForReference()getFieldValueForReferenceBlock()getFieldValueForIntegration()getFieldValueForCondition()
These are most useful in custom module or plugin code, where you already have the email notification or integration objects available.
$referenceValue = $submission->getFieldValueForReference('billingAddress');
$referenceBlockValue = $submission->getFieldValueForReferenceBlock('billingAddress', $notification);
$conditionValue = $submission->getFieldValueForCondition('subscribe');
$integrationValue = $submission->getFieldValueForIntegration('billingAddress', $integrationField, $integration, 'address');{% set referenceValue = submission.getFieldValueForReference('billingAddress') %}
{% set referenceBlockValue = submission.getFieldValueForReferenceBlock('billingAddress', notification) %}
{% set conditionValue = submission.getFieldValueForCondition('subscribe') %}
{% set integrationValue = submission.getFieldValueForIntegration('billingAddress', integrationField, integration, 'address') %}Use reference when you need the singular, string-like field value. Use reference block when you need the richer block value used by notification field rendering.
getFieldValue() returns the field’s PHP value. Use the helpers above when you need display text, JSON-safe data, exports or integration values.