Form

Group input fields in a form and submit them together. It supports scaling scale with content or remaining a fixed size with overflow options, and can check the validation status of nested input fields, clear on submission.

Form can generate the necessary input fields for a specified resource database table.

Properties

Available properties for Form with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read information about components.

NameTypeDescriptiondataobject

The source data for the component. It contains a key-value list of all current input fields, by formFieldKey, and their current values.

disableSubmitboolean

Whether to disable form submission.

disabledboolean

Whether user input, interaction, or selection is disabled.

enableFullBleedboolean

Whether the container is in full bleed mode, where it can only contain a single component which expands to fit the available space.

footerPaddingstring

The amount of padding used within the footer.

headerPaddingstring

The amount of padding used within the header.

heightType'auto' | 'fixed'

Whether the height automatically resizes to fit content or is a fixed size.

hiddenboolean

Whether the component is visible.

hoistFetchingboolean

Whether to display a loading indicator whenever nested components are fetching data.

initialDataobject

The data to populate as default values for input fields, by formFieldKey.

invalidboolean

Whether the current value has failed any validation rules.

loadingboolean

Whether to display a loading indicator.

maintainSpaceWhenHiddenboolean

Whether the component takes up space on the canvas if hidden is true.

marginstring

The amount of margin to render outside of the component.

overflowType'scroll' | 'hidden'

The overflow behavior when the contents exceeds the height of the component. Either scroll to display a scrollbar or hidden to clip the contents.

paddingstring

The amount of padding used within the container.

requireValidationboolean

Whether all input fields must be valid for the form to submit. If valid is false for any input field, the **Invalid event handler is triggered instead.

resetAfterSubmitboolean

Whether to reset input field values using initialData after form submission.

showBodyboolean

Whether to display the body of the component if heightType is auto.

showBorderboolean

Whether to show the border around the component.

showFooterboolean

Whether to display the footer area of the component.

showFooterBorderboolean

Whether to show the border above the footer area.

showHeaderboolean

Whether to display the header area of the component.

showHeaderBorderboolean

Whether to show the border under the header area.

showInEditorboolean

Whether the component remains visible in the editor if hidden is true.

submittingboolean

Whether the Submit event handler is currently running.

tooltipTextstring

The text to display in a tooltip on hover or focus.

Events

Events are triggered by user interactions with Form. Use event handling to trigger queries or other actions in response to events.

NameDescriptionSubmit

A user submits the current value.

Invalid

Methods

Methods for interacting with Form. You can write JavaScript almost anywhere in Retool and use methods to manipulate data or components.

NameDescriptionscrollIntoView(options: any)

Scrolls the canvas or parent container so that the selected component appears in the visible area.

setShowBody(showBody: boolean)

Set showBody value for the container

setShowHeader(showHeader: boolean)

Set showHeader value for the container

setShowFooter(showFooter: boolean)

Set showFooter value for the container

setHidden(hidden: boolean)

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

setDisabled(disabled: boolean)

Set the disabled value to toggle whether the input field is disabled. Defaults to true without a parameter.

submit()

Submit the form

setData(data: any)

Set the values of all child inputs

clear()

Clear the current values of all child components.

reset()

Reset all child inputs with formDataKey to their default values or clears them if no default value is set

validate()

Validate the form.

clearValidation()

Clear the validation state of the form.

Related components