External libraries

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

JS Library Reference

Using JS libraries

The external libraries can be used anywhere inside {{ }} just as javascript is used in the rest of the application. The signature of the JS libraries are exactly the same as mentioned in their documentation

Example: Lodash

An example of the Lodash _.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 the moment.js format utility, in use in a query.

insert into users (name, email, createdDate) values
('John', 'john@appsmith.com', '{{moment().format("YYYY-MM-DD")}}')