Use the Scripting API

How to extends App and Dashboard capabilities with API

Written By Vins

Last updated About 14 hours ago

Overview

The Scripting API in DataStripes allows you to automate workflows, build custom widgets, and extend spreadsheet functionality using TypeScript/JavaScript. Access and manipulate data, trigger actions, and integrate external libraries.

Getting Started

  1. Open the script editor or create a new custom widget from the App Builder.

  2. Use the global appApi object to interact with your spreadsheet. Example:

    // Read a cell value const value = await appApi.getCell('Sheet1', 'A1'); // Write a value await appApi.setCell('Sheet1', 'B2', 42); // Get a range const data = await appApi.getRange('Sheet1', 'A1:C10'); 
  3. Use CDN libraries (e.g., Chart.js, Leaflet) in custom widgets for advanced visualizations.

  4. Save and run your script or widget to see results in real time.

Advanced Usage

  • Event Listeners: React to data changes, user actions, or widget events.

  • API Integration: Fetch data from external APIs and display results in your sheet or widget.

  • Custom UI: Build interactive controls, charts, or dashboards inside widgets.

  • Security: Scripts run in a sandboxed environment—no access to sensitive data unless explicitly allowed.

Tips & Best Practices

  • Automate repetitive tasks (e.g., data cleaning, report generation).

  • Modularize code for reusability and clarity.

  • Use TypeScript for type safety and better autocompletion.

  • Review the API reference for all available methods and events.

Troubleshooting

  • If a script fails, check the console for error messages.

  • Ensure all async operations use await or proper promise handling.

  • For external libraries, verify CDN URLs and compatibility.


The Scripting API is your gateway to full customization—experiment and build solutions tailored to your workflow.