# SJS.AI.QUERY

## Content

## Summary

**SJS.AI.QUERY** is a function in SpreadJS that allows users to submit queries to an AI model for intelligent data processing and analysis. This function is particularly useful for scenarios requiring AI-enhanced transformations or insights based on existing data.

## Syntax

```javascript
=SJS.AI.QUERY(prompt, array)
```

## **​**Arguments

| Parameter | Description |
| --------- | ----------- |
| **prompt**<br>Required | A text description of the action you want the AI model to perform |
| **array**<br>Required | The input text or a cell reference containing the text to be processed by the action. |

**Remarks:**

* SJS.AI.QUERY is an asynchronous formula that will return #BUSY! during the analysis process.

## Examples

This formula reads country names from range **A2:A11** and returns their corresponding capital cities.

```auto
=SJS.AI.QUERY("Get the capitals of these countries", A2:A11) 
```

![image](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/image.976a13.png?width=700)