Skip to main content

The Microphone component for Retool Mobile

Recordings are Base64-encoded in WebM format, and audio playback displays a progress bar and elapsed time.

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.

buttonSize​

The size of the button.

Type string
Configurability Inspector
Allowed Values
ValueDescription
small

Small button.

large

Large button.

Defaultnull

events​

A list of configured event handlers that trigger actions or queries.

Type array
Array values object
Configurability Inspector > Interaction > Event handlers
Defaultnull
Array Object Properties

event​

The event that triggers the action. Refer to the events section for details of available events for this object.

Type string
Configurability Inspector > Interaction > Event handlers > Event
Defaultnull

method​

The JavaScript method to perform when type is datasource, widget, state, or localStorage.

Type string
Configurability Inspector > Interaction > Event handlers > Edit event handler > Run script actions
Defaultnull

type​

The type of action to perform.

Type string
Configurability Inspector > Interaction > Event handlers > Edit event handler > Action
Allowed Values
ValueDescription
datasource

Control query.

widget

Control component.

script

Run script.

state

Set variable.

localStorage

Set localStorage.

util

Perform utility action (e.g., Open URL or Confetti).

Defaultnull


file​

Details about the selected file.

Type object
Configurability Read-only
Defaultnull
Object Properties

lastModified​

The last modified date as a timestamp.

Type number
Format Timestamp
Configurability Read-only
Defaultnull
Examples
false1617024000000

name​

The file name with extension.

Type string
Configurability Read-only
Defaultnull

retoolStorageId​

The file ID if uploaded to Retool Storage.

Type string
Configurability Read-only
Defaultnull

size​

The file size, in bytes.

Type string
Configurability Read-only
Defaultnull

type​

The MIME type.

Type string
Configurability Read-only
Defaultnull

uploading​

Whether the file is uploading.

Type boolean
Configurability Read-only
Defaultnull


hidden​

Whether this object is hidden from view.

Type boolean
Format True/False
Configurability Inspector > Appearance > Hidden
Defaultfalse
Examples
falsetrue

isPublic​

Whether to make the file public when uploading with Retool Storage.

Type boolean
Configurability Inspector
Defaultnull

isRecording​

Whether the audio is being recorded.

Type boolean
Format True/False
Configurability Read-only
Defaultnull
Examples
falsetrue

startLabel​

The label for the start button.

Type string
Configurability Read-only
Defaultnull

stopLabel​

The label for the Stop button.

Type string
Configurability Read-only
Defaultnull

uploadToRetoolStorage​

Whether to upload a file to Retool Storage.

Type boolean
Configurability Inspector
Defaultnull

width​

The width.

Type number
Format Integer
Configurability Inspector
Defaultnull
Examples
false1280

Methods​

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

microphone.clearValue()​

Clear the current values.

Definition
microphone.clearValue()
Examples

Clear the current value of microphone.

microphone.clearValue();

microphone.reset()​

Reset all child inputs to default values or clears them if no default values are set.

Definition
microphone.reset()
Examples

Reset microphone.

microphone.reset();

microphone.resetValue()​

Reset the current value to the default value.

Definition
microphone.resetValue()
Examples

Reset the current value of microphone.

microphone.resetValue();

microphone.setDisabled()​

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

Definition
microphone.setDisabled(disabled)
Parameters

disabled​

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Disable microphone.

microphone.setDisabled(true);

Enable microphone.

microphone.setDisabled(false);

microphone.setHidden()​

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

Definition
microphone.setHidden(hidden)
Parameters

hidden​

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide microphone.

microphone.setHidden(true);

Unhide microphone.

microphone.setHidden(false);

microphone.setValue()​

Set the current value.

Definition
microphone.setValue(value)
Parameters

value​

The value.

Type string | number | boolean | object | array

Examples

Set the current value of microphone to userValue.

microphone.setValue(userValue);

Events​

Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.

EventDescription
ChangeThe value is changed.