The File Input component for Retool Apps
An input field to select single or multiple files.
Refer to the File inputs guide for more information on how to use this component.
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
appendNewSelection
Whether to append additional files to the value.
Type | boolean | ||||
Mutability |
|
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
Array Object Properties
iconAfter
The suffix icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
iconBefore
The prefix icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
isPublic
Whether to make the file public when uploading with Retool Storage.
Type | boolean | ||||
Mutability |
|
labelPosition
The position of the label relative to the input field or value.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
loading
Whether to display a loading indicator.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
parseFiles
Whether to parse plain-text content.
Type | boolean | ||||
Mutability |
|
placeholder
The text to display within the input field when there is no value.
Type | string | ||||
Format | string | ||||
Mutability |
| ||||
Default |
|
Examples
selectionType
The type of file selection.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
shouldOverwriteOnNameCollision
Whether to replace a file with the same name when uploading with Retool Storage.
Type | boolean | ||||
Mutability |
|
showClear
Whether to display a button to clear the value of the input field.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
style
Custom style options.
Type | object | ||||
Mutability |
|
textAfter
The suffix text to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
textBefore
The prefix text to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
uploadToRetoolStorage
Whether to upload a file to Retool Storage.
Type | boolean | ||||
Mutability |
|
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.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
fileInput.scrollIntoView(options)
Parameters
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
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. |
Parse | Data is parsed. |