Skip to content

Forms ​

Page Flow Blocks reference.

Blocks ​

Data Table Attach Form ​

Block name: datatableattachform

Attaches one of your app forms to a Data Table widget for creating and or editing records.

Inputs ​

InputTypeDescriptionAccepts
data tableelementThe id of the Data Table widget that should use the attached form. Use the element's HTML id attribute value. Do not use AI IDs such as ai:... or data-tvwa-ai-id; those IDs are only for modification commands. You can type the element id directly or click the lookup button to select from valid elements available in the current context.
attach typechoiceWhich Data Table actions should use the attached form.
form slugstringThe form slug to use for the selected Data Table actions.
titlestringThe modal title to show when the attached form opens.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that resolves the Data Table widget element and sends an attach-form command with the selected form configuration.

Calls: $io.dom.elementIdSel, $io.ui.widgetCommand

Delete Uploaded File ​

Block name: form_mark_uploaded_delete

Marks an uploaded file for deletion, or cancels an existing delete mark for that file.

Inputs ​

InputTypeDescriptionAccepts
fieldstringThe file field name to update. This is typically provided by a text block.text
namestringThe uploaded file name to update. This is typically provided by a text block.
cancelbooleanWhether an existing delete mark should be canceled. This is typically provided by a logic_boolean block. Use false to mark the file for deletion, or true to cancel a previously marked deletion.logic_boolean

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that marks an uploaded file for deletion, or cancels that mark when the cancel input is true.

Calls: $io.form.markUploadedFileForDelete

Enable or Disable Delete File Action for Field ​

Block name: form_set_file_delete_state

Enables or disables the delete-file action for a form file field.

Inputs ​

InputTypeDescriptionAccepts
actionchoiceWhether delete-file actions should be enabled or disabled for the field.
fieldstringThe file field name to update. This is typically provided by a text block.text

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that updates whether delete-file actions are disabled for the selected field. The runtime call uses a disable flag, so choosing Enable causes disableFileDelete to receive false.

Calls: $io.form.disableFileDelete

Enable or Disable New File Uploads for Field ​

Block name: form_set_file_upload_state

Enables or disables new file uploads for a form file field.

Inputs ​

InputTypeDescriptionAccepts
actionchoiceWhether new file uploads should be enabled or disabled for the field.
fieldstringThe file field name to update. This is typically provided by a text block.text

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that updates whether new file uploads are disabled for the selected field. The runtime call uses a disable flag, so choosing Enable causes disableFileUpload to receive false.

Calls: $io.form.disableFileUpload

Form Data ​

Block name: formdataobject

Provides an object containing the current values entered in the form fields.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates client-side code that reads the current form data object from the ioLoop form runtime.

Calls: $io.form.getFormData

Form Events ​

Block name: handleformevents

Registers custom logic for key lifecycle events of a form, including initialization, validation, submission, success, and error handling.

Inputs ​

InputTypeDescriptionAccepts
on initstatementsThe statements to run when the form is initialized. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on pre-validatestatementsThe statements to run before form validation begins. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on post-validatestatementsThe statements to run after validation finishes. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on submitstatementsThe statements to run when the form submit action starts. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on successstatementsThe statements to run after a successful form submission. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on errorstatementsThe statements to run after a failed form submission. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that registers custom form event hooks on the active ioLoop form object. The nested blocks are emitted inside generated callbacks with formInfo, returnInfo, dataObj, succInfo, and errInfo depending on the form lifecycle event, so customcode and customcodeexpr blocks inside those handlers can access the matching in-scope callback variables directly.

Calls: window.tvWaDataForm.setCustomHooks

Form is in Edit Mode ​

Block name: formisineditmode

Checks whether the current form is being used to edit existing data instead of creating new data.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates client-side code that checks whether the active form is currently in edit mode.

Calls: $io.form.isEditMode

Form Original Edit Data ​

Block name: formeditdataobject

Provides the original data object being edited by the form when the form is in edit mode.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates client-side code that reads the original edit data object from the ioLoop form runtime.

Calls: $io.form.getOriginalEditData

Form Submit Complete ​

Block name: formonsubmitcallback

Signals back to the form runtime that custom submit processing has completed.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that tells the ioLoop form runtime that custom submit handling has finished.

Calls: $io.form.customSubmitComplete

Lock or Unlock Form ​

Block name: lockform

Locks the active form to prevent submission, or unlocks it again after processing is complete.

Inputs ​

InputTypeDescriptionAccepts
actionchoiceWhether the form should be locked or unlocked.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that changes the locked state of the active form.

Calls: $io.form.lock

Popup Form Data ​

Block name: modalformdata

Provides the data object returned by a popup form callback.

Output ​

This block produces an output value of type Any.

Behavior ​

Generates client-side code that reads the current popup form callback result object and returns its data value when available.

Remove Un-uploaded File ​

Block name: form_remove_unuploaded

Removes a file that is attached to a form file field but has not yet been uploaded.

Inputs ​

InputTypeDescriptionAccepts
fieldstringThe file field name to update. This is typically provided by a text block.text
indexnumberThe zero-based file index to remove. This is typically provided by a math_number block.math_number
namestringThe file name to remove. This is typically provided by a text block.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that removes a pending un-uploaded file from the selected form field by index or name.

Calls: $io.form.removeUnploadedFile

Reset Form ​

Block name: resetform

Clears the active form's field values, validation messages, and validation state.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that resets the active form to its initial empty state.

Calls: $io.form.reset

Save Form with Data ​

Block name: saveform

Submits the active form using either the current form data or a custom data object.

Inputs ​

InputTypeDescriptionAccepts
dataobjectThe data to submit with the form. This is often provided by a formdataobject block when you want to submit the current form values, but define_object can also be used when you want to submit custom data.formdataobject

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that submits the active form with the provided data object or with null when no data input is connected.

Calls: $io.form.save

Set Form Event Status ​

Block name: formeventreturnstatus

Sets the form event status to OK or ERROR when used inside form event handling logic.

Inputs ​

InputTypeDescriptionAccepts
statuschoiceThe status value to set for the current form event.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that sets the form event status, using the current returnInfo object when it exists.

Calls: $io.form.setStatus

Set Form Event Status Message ​

Block name: formeventmsg

Sets the status message shown by the current form event handling logic.

Inputs ​

InputTypeDescriptionAccepts
messagestringThe status message to show on the form. This is typically provided by a text block, but blocks such as alert can also be used when you want formatted message content.text

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that sets the form event status message, using the current returnInfo object when it exists.

Calls: $io.form.setStatusMessage

Show Information Popup ​

Block name: informmodal

Shows an informational modal popup with a title and message, then runs the nested logic when the popup is closed.

Inputs ​

InputTypeDescriptionAccepts
titlestringThe popup title. This is typically provided by a text block.text
messagestringThe message shown in the popup. This is typically provided by a text block.text
customizationobjectOptional modal customization settings.
when closedstatementsThe blocks to run after the popup is closed. Nested blocks run inside the generated callback for this block.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that shows an informational modal popup and runs the nested statements after the returned promise resolves. The nested blocks are emitted inside function() { ... }; that callback does not define a result parameter.

Calls: $io.ui.showInfoModal

Show Popup Form ​

Block name: showmodalform

Shows one of your app forms as a modal popup and lets you handle save success and close results. This is the normal way for another page to open an ioLoop form; do not create a normal page link or navigation action to a form unless the author explicitly asks for a standalone form URL.

Inputs ​

InputTypeDescriptionAccepts
form slugstringThe form slug to open in the popup.
titlestringThe popup title. This is typically provided by a text block.text
dataobjectOptional data object to pass into the form, for example when opening the form for editing.
customizationobjectOptional modal customization settings.
shared infoobjectOptional shared information object to pass into the popup form. Inside the popup form's Page Flow, this shared information is accessible through the tvexportobject block. In JavaScript code, properties in this same shared object can also be accessed with $io.system.getFlowShareData and updated with $io.system.setFlowShareData.
on save successstatementsThe blocks to run when the form reports a save success result. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on form close successstatementsThe blocks to run when the popup form closes with a success result. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.
on form close failurestatementsThe blocks to run when the popup form closes with a failure result. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables.

Output ​

This block does not produce an output value.

Behavior ​

Generates client-side code that opens the requested form in a modal popup and wires the nested statement blocks into the modal callbacks. The nested blocks are emitted inside function(mdlResp) { ... }, so customcode and customcodeexpr blocks inside the modal callbacks can access mdlResp directly. Prefer this block over page navigation when a button, menu item, table action, or link-like UI should open a form.

Calls: $io.ui.showFormModal

Un-uploaded File List for Field ​

Block name: formunuploadedfilelistforfield

Gets the list of files that are currently attached to a form file field but have not yet been uploaded.

Inputs ​

InputTypeDescriptionAccepts
fieldstringThe file field name to inspect. This is typically provided by a text block.text

Output ​

This block produces an output value of type Array.

Behavior ​

Generates client-side code that reads the pending un-uploaded file list for a form file field.

Calls: $io.form.getUnUploadedFiles

Uploaded File List for Field ​

Block name: formfilelistforfield

Gets the list of files that have already been uploaded for a form file field.

Inputs ​

InputTypeDescriptionAccepts
fieldstringThe file field name to inspect. This is typically provided by a text block.text

Output ​

This block produces an output value of type Array.

Behavior ​

Generates client-side code that reads the uploaded file list for a form file field.

Calls: $io.form.getUploadedFiles