Skip to main content

The NFC Reader component for Retool Mobile

An interface to capture data from an NFC tag.

NFC Reader supports reading NDEF-formatted tags. Please reach out if your use case requires reading other NFC formats.

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

Examples
"Label"

data

The data.

Type string | number | boolean | object | array
Format Custom data
Configurability Inspector
Defaultnull

disabled

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

Type boolean
Format True/False
Configurability Inspector > Interaction > Disabled
Defaultfalse
Examples
true

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


hidden

Whether this object is hidden from view.

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

Examples
/icon:bold/shopping-gift

Examples
/icon:bold/shopping-gift

rawData

The initial data before any transformation of results.

Type object
Configurability Read-only
Defaultnull

width

The width.

Type number
Format Integer
Configurability Inspector
Defaultnull
Examples
1280

Methods

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

nfcReader.read()

Read data.

Definition
nfcReader.read()

nfcReader.reset()

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

Definition
nfcReader.reset()
Examples

Reset nfcReader.

nfcReader.reset();

nfcReader.setDisabled()

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

Definition
nfcReader.setDisabled(disabled)
Parameters

disabled

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

Type boolean
Format True/False
Default
false
Examples
true

Examples

Disable nfcReader.

nfcReader.setDisabled(true);

Enable nfcReader.

nfcReader.setDisabled(false);

nfcReader.setHidden()

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

Definition
nfcReader.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide nfcReader.

nfcReader.setHidden(true);

Unhide nfcReader.

nfcReader.setHidden(false);

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
CaptureA value is captured.