Create Custom Card

Example
Prompt
Code

Tutorial

Here is a step-by-step tutorial on how to complete the function fn:

ts
let sql = `SELECT count(1) as quantity FROM users`;

Execute the SQL query: Use the query method provided in args to execute the SQL query and get the results.

ts
let results = await args.find(sql);

Display the chart: Use the value method provided in args to send the formatted data response.

ts
return args.value(data);

Final Result

With these steps, you have completed the fn function. Now, when this function is called, it will return a card showing the number of users created. Make sure to adjust the code according to your application's specifications and structure.

ts
const fn = async function (args: Args) { let sql = `SELECT count(1) as quantity FROM users `; let results = await args.find(sql); return args.value(results); };
How to create ChartLines
Click to go
How to create Tables
Click to go
On this page

Create Custom Card

Tutorial

Final Result

View this page on
GitHub

Do you have specific enterprise needs? Contact our sales team.

get enterprise

Make your business efficient in seconds.

Create dashboards and backoffices in seconds
Start now