The File Input component for Retool Mobile
An input field to select single or multiple files.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
accept
A list of file extensions or file-type specifiers to accept.
Type | array | ||||
Array values | string | ||||
Mutability |
|
Examples
customValidation
A custom validation rule using {{ }}
expression with conditional logic. An invalid match evaluates to a string which is used as the validation message. An empty or nullish value is considered valid.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
|
Examples
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
events
A list of configured event handlers that trigger actions or queries.
Type | array | ||||
Array values | object | ||||
Mutability |
|
Array Object Properties
Object Properties
formDataKey
The key used by a Form component to assign default values to input fields using form.initialData
, and to construct the form.data
property.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
hideValidationMessage
Whether to hide the validation message if the invalid
is true
.
Type | boolean | ||||
Mutability |
|
isPublic
Whether to make the file public when uploading with Retool Storage.
Type | boolean | ||||
Mutability |
|
label
The text label to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
placeholder
The text to display within the input field when there is no value.
Type | string | ||||
Format | string | ||||
Mutability |
| ||||
Default |
|
Examples
required
Whether a value is required to be selected.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
shouldOverwriteOnNameCollision
Whether to replace a file with the same name when uploading with Retool Storage.
Type | boolean | ||||
Mutability |
|
uploadToRetoolStorage
Whether to upload a file to Retool Storage.
Type | boolean | ||||
Mutability |
|
validationMessage
The validation message to display if invalid
is true
.
Type | string |
Format | Plain Text |
Mutability | Read-only |
Array Object Properties
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
fileInput.clearValidation()
Examples
fileInput.resetValue()
Examples
fileInput.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
fileInput.setDisabled(disabled)
Parameters
Examples
fileInput.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
fileInput.setHidden(hidden)
Parameters
Examples
fileInput.setValue(value)
Parameters
Examples
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Change | The value is changed. |