Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.26 KB

ext-libraries.md

File metadata and controls

42 lines (30 loc) · 1.26 KB
description
The Appsmith platform includes JavaScript utility libraries, which can be used to work with data within `{{ }}` bindings.

External libraries

JavaScript Library Reference

{% embed url="https://youtu.be/tqJna718tj4" %}

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

{{
  _.map(fetchFruits.data, (fruit) => { 
    return { label: fruit.name, value: fruit.id } 
    })
}}

Example: moment

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")}})