For the complete documentation index, see llms.txt. This page is also available as Markdown.

DefaultValueSources

Introduction

DefaultValueSources define how a FormField receives a prefilled value when a form is rendered.

For forms, there are administration endpoints to create, update, and delete default value sources. Additionally, forms expose a runtime endpoint to resolve and return effective default values:

  • GET /api/forms/{form}/default-values

Get resolved default values for a form

Return the resolved default values for all form fields of a form.

Definition

GET /api/forms/{form}/default-values

Authorization

  • Requires access to the form (show permission on the form).

  • Available for authenticated API users and permalink context.

Behavior

  • The endpoint resolves default values by processing the configured default value sources per field.

  • Sources are evaluated in sort_number order per field.

  • The first source that can be resolved for a field is returned.

  • If a source cannot be resolved (e.g. missing context data), it is skipped and the next source is tried.

  • Response data is keyed by form_field_id.

Example Request

Example Response

Model Definition

Alias

defaultValueSource

Relations

Relation
Key
Type
Relation Field(s)

formField

Belongs to

form_field_id

sourceEntity

Morph to

source_entity_*

[Adm.] Create

Create a new DefaultValueSource.

Definition

POST /api/administration/forms/fields/default-value-sources

Request Keys

Key
Type
Default
Description

source_type*

string

-

Source type. Allowed values: formFieldValue, systemVariable.

form_field_id*

integer

-

Related FormField ID.

config

object

{}

Source-specific configuration.

source_entity_type

string | null

null

Morph alias for source entity. For forms this can be formField. Required with source_entity_id.

source_entity_id

integer | null

null

Source entity ID. Required with source_entity_type.

sort_number

integer

auto

Sort order within the same form_field_id.

Keys with * are required.

Source-specific config

  • formFieldValue

    • No required config keys.

    • Typical usage: combine with source_entity_type = formField and source_entity_id = {formFieldId}.

  • systemVariable

Example Request

Example Response

[Adm.] Update

Update an existing DefaultValueSource by id.

Definition

PUT /api/administration/forms/fields/default-value-sources/{id}

Request Keys

Key
Type
Description

source_type

string

New source type (formFieldValue, systemVariable).

form_field_id

integer

New related FormField ID.

config

object

Source-specific configuration.

source_entity_type

string | null

Morph alias for source entity (formField for forms).

source_entity_id

integer | null

Source entity ID.

sort_number

integer

Sort order within the same form_field_id.

Behavior notes

  • If source_type is not provided, the existing type is used for validation.

  • If source_type changes and config is omitted, default config for the new type is applied before validation.

  • If form_field_id is changed, create-authorization is checked for the new target field.

Example Request

Example Response

[Adm.] Delete

Delete an existing DefaultValueSource by id.

Definition

DELETE /api/administration/forms/fields/default-value-sources/{id}

Example Request

Example Response

Last updated