Skip to content

Fields and submission values ​

A submission separates the form definition from its current values. This response fragment shows one amount and a choice field's options.

In a run-based screen, step binding selects the step and output submission first. Field labels and canonical field names belong to the form inside that output.

json
{
  "submissionId": "submission-1",
  "formId": "form-1",
  "formGroups": [
    {
      "id": "form-group-1",
      "name": "Financial figures",
      "fields": [
        { "id": "field-1", "name": "TotalAssets", "type": "money" },
        {
          "id": "field-2",
          "name": "AuditorOpinion",
          "type": "enum",
          "options": ["unqualified", "qualified", "adverse"]
        }
      ]
    }
  ],
  "groups": [
    {
      "id": "group-1",
      "formGroupId": "form-group-1",
      "items": [
        {
          "id": "item-1",
          "versionId": "version-1",
          "formField": {
            "id": "field-1",
            "name": "TotalAssets",
            "type": "money"
          },
          "value": 1250000,
          "sourceType": "document"
        }
      ]
    }
  ]
}

Fields and values ​

A form field has a canonical name, a declared type and, for a choice, options. formGroups[].fields describes the form. groups[].items holds values and embeds each item's formField identity. Both views include the stored field type and deprecation flag.

IdentifierUse
formField.nameStable mapping key in your application and per-field configuration
formField.idField definition and viewer filtering
Item idCorrection target and source selection
Group idOne entry in a repeating group

The item's versionId identifies the version supplying its current value and source. It is null when no version exists. It is separate from the item ID used for corrections. A correction save returns the newly created versionId for a value edit or clear, including an edit that keeps the same value. A feedback-only save returns null. Correction history reads do not include this save acknowledgement. A version ID does not grant permission to edit or make a correction conditional on that version.

Field types ​

TypeDisplayEditing
stringTextSingle-line input
string-longLong textText area
numberLocale-aware numberDecimal input
moneyNumeric amountDecimal input
booleanLocalised Yes or NoTrue or False select
dateLocalised calendar dateDate picker
emailTextText input
urlTextText input
enumOption labelSelect, or searchable choices in a drawer above 20 options

The form's options supplies an enum's choices. optionSynonyms supplies translated labels while option values remain stable. Inline editing always uses a native select. Boolean values on the API are represented as strings; item values are strings, numbers or null.

A Single field displays a numeric amount when Sea has no currency metadata. It does not add a default currency or unit.

Mapping a screen generated at runtime ​

For a database-defined layout, compose Single fields under one Context provider. Each binding loads its value and saves corrections through that context.

tsx
import * as React from "react";
import { SeaContextProvider } from "@sea-dev/widget-lit/react/context";
import { SeaField } from "@sea-dev/widget-lit/react/field";
import { SeaPdfViewer } from "@sea-dev/widget-lit/react/pdf-viewer";

export class LayoutReview extends React.Component<{
  bearerToken: string;
  submissionId: string;
  rows: Array<{
    id: string;
    label: string;
    formFieldId: string;
    submissionGroupId?: string;
  }>;
  onSaved: () => void;
}> {
  render() {
    const p = this.props;
    return (
      <SeaContextProvider
        bearerToken={p.bearerToken}
        submissionId={p.submissionId}
      >
        <div style={{ display: "flex", height: 640 }}>
          <SeaPdfViewer style={{ flex: 1, minWidth: 0 }} />
          <div style={{ flex: 1, minWidth: 0, overflow: "auto" }}>
            {p.rows.map((row) => (
              <SeaField
                key={row.id}
                label={row.label}
                binding={{
                  formFieldId: row.formFieldId,
                  submissionGroupId: row.submissionGroupId,
                }}
                onCorrectionSubmitted={() => p.onSaved()}
              />
            ))}
          </div>
        </div>
      </SeaContextProvider>
    );
  }
}

Translated display labels can change without changing canonical names. Read results shows how to fetch corrections and original documents.

Sources ​

Document values use sourceType: "document"; corrected values use "manual". A source citation can identify a page region, image region or spreadsheet cell. OCR confidence describes source readability. Source viewers displays those locations.