Skip to main content

The Tools JavaScript library

JavaScript methods to reformat data.

Utility functions to transform data.

Methods

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

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

formatDataAsArray()

Formats data as an array.

Definition
formatDataAsArray(data)
Parameters

data

The data.

Type string | number | boolean | object | array
Format Custom data

Returns

data

The data.

Type string | number | boolean | object | array
Format Custom data


formatDataAsObject()

Formats data as an object.

Definition
formatDataAsObject(data)
Parameters

data

The data.

Type string | number | boolean | object | array
Format Custom data

Returns

data

The data.

Type string | number | boolean | object | array
Format Custom data


swap()

Swap the position of two array items.

Definition
swap(swapOptions)
Parameters

swapOptions

(No description available)

Type object
Object Properties

data

The data.

Type string | number | boolean | object | array
Format Custom data

indexA

The index of the first item to swap.

Type number

indexB

The index of the second item to swap.

Type number