Skip to main content Skip to footer

New AI Features in JavaScript Spreadsheets: Natural Language and Smart Analysis

With the release of SpreadJS v18.1, developers can now explore a powerful new set of AI-driven features designed to transform how users interact with JavaScript spreadsheets. Whether you're building internal analytics tools, interactive dashboards, or finance-driven web apps, the new AI Add-on introduces natural language assistance, automated insights, and intelligent formula generation—all embedded into the familiar spreadsheet environment.

In this blog, we'll walk through each AI feature introduced in SpreadJS, show you how to use them, and highlight the value they bring to your application and users.

The AI Add-on is currently available in preview mode and will be officially released later this year. Features may evolve based on user feedback and testing.


🧠 SpreadJS AI Add-on Overview (Developer Preview)

The new SpreadJS AI Add-on is available in preview mode and includes the following capabilities:

To use the Developer Preview of SpreadJS' AI Add-On features, developers can install and import the '@mescius/spread-sheets-ai-addon' module and configure it with their preferred LLM provider. The add-on accepts a configuration object containing parameters such as key, basePath, defaultTemperature, and model. For best practice, we recommend using a proxy and not exposing api keys in the client. 

import * as GC from "@mescius/spread-sheets";
import '@mescius/spread-sheets-ai-addon';

// Initialize SpreadJS workbook
const workbook = new GC.Spread.Sheets.Workbook('ss');

// Directly configure AI service credentials
workbook.injectAI({
    model: 'gpt-4-turbo',  // Specify your AI model
    key: 'sk-your-api-key-here',  // Your API key
    basePath: 'https://api.openai.com/v1',  // API endpoint
    
    // Optional advanced parameters
    organization: 'your-org-id',  // For OpenAI organizations
    timeout: 30000,  // Request timeout in ms
    defaultTemperature: 0.7  // Default creativity level
});

The AI module communicates with the provider's API endpoint to submit prompts, receive responses, and process them contextually within the worksheet. All API calls are handled securely, and prompt injection is sanitized before processing.

If you notice above, you are specifying not only the endpoint (AI service provider), but even your model. You can use the SpreadJS AI Add-on with your own pre-trained model! Our only requirement is that the response from the service complies with the OpenAI Schema. This allows you to leverage your own AI models within SpreadJS, including any business-specific or industry-specific machine learning. 

Now your users will have the full power of AI in their spreadsheets! They will see some added AI buttons that will launch helper panels and dialogs. 

JavaScript Spreadsheet AI Button
SpreadJS AI Button

Get started with our AI Spreadsheet Documentation.

Download SpreadJS today to start building with the best JavaScript Spreadsheet on the market!


✨ AI-Assisted Formula Generation and Explanation

The AI Add-on introduces natural language-to-formula conversion as well as formula explanations. Users can type in plain English and receive a valid formula based on spreadsheet context. They can also request a breakdown of what a complex formula does.

JavaScript AI generated a formula to filter numeric values and select the top 3 salespeople
AI generated a formula to filter numeric values and select the top 3 salespeople

Here are a few ideas for using AI-assisted formulas:

  • Generating complex formulas: Describe your requirements step by step (for example, filter first, then sum).
  • Debugging formulas: Use the "Explain" feature to verify the correctness of your formula's logic.
  • Learning tool: Learn how to use functions through AI-generated formulas and explanations.

This feature helps both new users and power users reduce the friction of writing or understanding formulas. Don’t forget to be specific and descriptive when prompting the AI!

Learn more in our AI-Assisted Formula documentation or try our AI Formula Assist demo.


📊 AI-Assisted PivotTable Creation

The SpreadJS AI add-on enhances the JavaScript PivotTable Panel with artificial intelligence capabilities. With a few words of input, users can generate fully structured PivotTables—including row/column assignments and aggregation logic.

This is ideal for dynamic data exploration in business intelligence scenarios. Users don’t need to manually drag and drop fields—they simply describe the insight they want.

To get started, click the A button in the PivotPanel. This will open the AI Generation Panel.

JavaScript Pivot Table AI Assistant Button
SpreadJS Pivot Table AI Assistant Button

Describe What You Want

Now, you can describe what you would like to see in your PivotTable, for example "Show sales by cars and quarters". Hit enter, and the AI will build your view.

JavaScript Spreadsheet AI generated view for “Show sales by cars and quarters”
AI generated view for “Show sales by cars and quarters”

Get Suggestions From AI

Not only can AI build views for you, it can suggest interesting views in your PivotTable. 

Click the “AI Suggestions” button at the bottom of the PivotPanel to see what it recommends.

AI-suggested PivotTable views
AI-suggested PivotTable views

Intelligent Analysis

Let’s take things a step further and use AI to analyze our data. Click the "I" button to open the AI analysis interface.

Click the "I" button to open the JavaScript Pivot Table AI analysis interfaceAsk your question to the AI and watch as it analyzes the data and summarizes its findings. For example, we can ask "The person with the highest sales in the third quarter?" and see as follows.

JavaScript Pivot Table Component's Intelligent Data Analysis
AI explaining who had the highest sales in Q3

PivotTables are an amazing way of analyzing data, especially aggregation of large datasets. But making PivotTables can be a big challenge.

Learn more in our AI-Assisted PivotTable docs or try our AI-Assisted PivotTable demo.


🧪 New AI Worksheet Functions

Three new worksheet functions allow developers and users to perform AI-driven tasks directly in formulas from within their spreadsheets.

=SJS.AI.QUERY(prompt, array)

Transforms a natural language question into a logical expression that can be used in filters, selections, or summaries.

=SJS.AI.TRANSLATE(array, language)

Uses AI to translate the content of a cell into the target language.

=SJS.AI.TEXTSENTIMENT(array, positive, negative, [neutral])

Returns sentiment classification (e.g., positive, neutral, negative) for any cell’s textual value.

JavaScript Spreadsheet AI analyzing Reviews as Good, Bad or Neutral
AI analyzing Reviews as Good, Bad or Neutral

These functions allow developers to introduce intelligent automation to reporting, internationalization, and NLP use cases without leaving the spreadsheet environment.

Learn more in our QUERY, TRANSLATE and TEXTSENTIMENT docs or try our AI Functions demo.


🚀 Benefits of AI in Spreadsheets

The addition of AI into spreadsheets (specifically SpreadJS) brings substantial benefits:

  • Accelerated workflows – natural language input reduces time spent navigating UIs
  • User empowerment – lowers the learning curve for formulas and PivotTables
  • Context-aware automation – AI features respond to cell-level or workbook-wide context
  • Embedded intelligence – all features run within the spreadsheet interface; no external tools required

For business apps and embedded analytics platforms, these AI features can improve user adoption, reduce training needs, and drive faster decision-making. 

Common Questions about AI at MESCIUS

AI is new to many of us and we get asked a lot of questions about it. Now that we are releasing an optional AI feature, we want to make sure those questions are answered! Below are a few common questions about AI use.

Q: Does SpreadJS use AI to generate Source Code?
A: No. SpreadJS was developed solely by human effort. It does not involve the use of any artificial intelligence technology in its code creation.

Q: Does SpreadJS offer an AI feature?
A: Yes, using a separate add-on. SpreadJS has an optional paid AI Add-on that integrates it directly with 3rd-party AI services. This optional set of features adds “smart tools” to your spreadsheets. When integrated with an AI service, SpreadJS is enhanced with:

  1. Formula generation and explanation using natural language
  2. PivotTable generation based on descriptive input
  3. AI worksheet functions for text processing and translation

SpreadJS does not require the use of AI for any of its core functionality and features. AI integration is purely optional using a separate add-on.

MESCIUS does not offer AI services. Some MESCIUS products like SpreadJS integrate directly with 3rd-party AI services to add specialized AI features.

MESCIUS does not see, save or store any of the information used in the SpreadJS AI add-on. SpreadJS passes the data directly to the 3rd-party AI service that you have chosen and configured. No data is ever sent to MESCIUS servers.


 AI Features in JavaScript Spreadsheets

With the AI Add-on in SpreadJS v18.1, your JavaScript spreadsheets can now think, translate, explain, and suggest—directly inside your app. Give it a try and see how AI-driven insights can unlock new possibilities for your users.

Ready to check it out? Download SpreadJS Today!

Tags:

comments powered by Disqus