description |
---|
The Appsmith platform includes JavaScript utility libraries, which can be used to work with data within `{{ }}` bindings. |
{% embed url="https://youtu.be/tqJna718tj4" %}
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
Following is an example of the Lodash _.map
utility, in use. fetchFruits is the name of the API / Query
{{
_.map(fetchFruits.data, (fruit) => {
return { label: fruit.name, value: fruit.id }
})
}}
An example of the moment.js format
utility, in use in a query.
insert into users (name, email, createdDate) values
('John', '[email protected]', {{moment().format("YYYY-MM-DD")}})