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

JavaScript Library Reference

Using JavaScript libraries

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

Example: Lodash

Following is an example of the Lodash _.map utility, in use. fetchFruits is the name of the API / Query
1
{{
2
_.map(fetchFruits.data, (fruit) => {
3
return { label: fruit.name, value: fruit.id }
4
})
5
}}
Copied!

Example: moment

An example of the moment.js format utility, in use in a query.
1
insert into users (name, email, createdDate) values
2
('John', '[email protected]', {{moment().format("YYYY-MM-DD")}})
Copied!