Google Sheet Integration
This page guides users on how to integrate MaiAgent's powerful AI capabilities into Google Sheets using Google Apps Script. Through this method, you'll be able to directly call your MaiAgent Chatbot within spreadsheets and implement batch processing for multiple inputs, significantly improving work efficiency.
Getting Started
Step 1: Open Google Apps Script Editor
Open the Google Sheet where you want to integrate MaiAgent, or create a new spreadsheet.
Click "Extensions" > "Apps Script" in the top menu.

Step 2: Paste and Configure the Script
In the Apps Script editor, you'll see a file named
Code.gs. Clear its default content.Copy and paste the complete Apps Script code provided by MaiAgent in the attachment below into the
Code.gsfile.Replace the API_KEY and CHATBOT_ID at the beginning.
After replacing, click the save icon (💾) at the top of the editor to save your script.
Using MaiAgent Functions in Google Sheet
After completing the above setup and successful authorization, you can use the maiagent function in Google Sheet just like built-in functions.
1. Single Agent Call
In any cell, enter a formula in the following format:
=maiagent("The message content you want to send to the Agent")
For example:
=maiagent("Hello, please introduce yourself")=maiagent("The weather is nice today")
After pressing Enter, the script will send your message to the specified MaiAgent AI assistant and display the AI assistant's response in that cell.
2. Reading Message Content from Other Cells
You can have the maiagent function read content from other cells as input messages.
Suppose cell A1 contains the message you want to send, you can enter in another cell (e.g., B1):
=maiagent(A1)
This way, cell B1 will display MaiAgent's response to the content in A1.
Integration Demo Video
Conclusion
Integrating MaiAgent into Google Sheets through Google Apps Script opens up new possibilities for automation and productivity enhancement. Technical personnel can use this method to customize spreadsheets according to specific needs, making them powerful AI interaction tools, whether for content generation, data analysis, or automated responses.
Attachment
Last updated
Was this helpful?
