Working with JS libraries

The Appsmith platform includes Javascript utility libraries, which can be used to work with data within `{{ }}` bindings.

Included JS libraries

The following JS libraries are supported in the Appsmith platform.

Using JS libraries

The utility functions provided by the included libraries can be used when transforming data.

Example: lodash

An example of lodash's _.map utility, in use.

{{
_.map(fetchFruits.data, (fruit) => {
return { label: fruit.name, value: fruit.id }
})
}}
// fetchFruits is the name of the API / Query

Example: moment

An example of moment's format utility, in use in a Table's data property.

{{
_.map(getTickets.data, (ticket) => ({
label: ticket.name,
description: ticket.desc,
displayDate: moment(ticket.created_date).format("L") // user friendly display date
}))
}}
// getTickets is the name of the API / Query