The Konfuzio Chat add-on allows users to integrate AI-powered document and knowledge management into Google Sheets™. With this add-on, users can interact with a chatbot that retrieves answers from a specified Konfuzio Chat knowledge base, simplifying the process of extracting key insights and automating document workflows.

Main functions
The AI-powered chatbot helps you to query your individual knowledge base directly in Google Sheets™ and provides efficient document analysis without having to switch between applications. By specifying the knowledge base you want to query, the chatbot provides highly relevant answers based on your requirements.
How it works
The Konfuzio Chat add-on is designed to interact seamlessly with your knowledge bases stored in Konfuzio. You can use a simple function to retrieve answers from the chatbot.
For example, you can use the
=answer(query, knowledgebaseId)
in Google Sheets™ to ask a question:
Example:
=answer("What is the current status of project ABC?", "123456")
In this example, the query is "What is the current status of project ABC?" and the knowledgebaseId is "123456", which refers to the specific knowledge base to be searched.
The chatbot processes the query, analyzes the knowledge base and returns the answer directly in the cell of the spreadsheet in which you entered the function.
Why use the Konfuzio Chat Add-on:
This add-on saves you time by automating the retrieval of relevant information from your customized knowledge base, ensuring accuracy and efficiency in your workflows. With the ability to pull data directly into Google Sheets™, the add-on simplifies data management and analysis, all within a familiar user interface.
For more information and setup instructions, please visit our website at konfuzio.com.
Integrating your Konfuzio chatbot with Google Sheets can help you automate manual processes and make collaboration more efficient. With this integration, you can access your chatbot directly in Google Sheets to get answers to common questions from your knowledge base. Here's a step-by-step guide on how to set up and use this integration.
Advantages of integration
- Workflow automationGet answers from your Konfuzio chatbot without leaving Google Sheets.
- Time saving: Call up answers to frequently asked questions directly in your spreadsheets.
- Improved productivityIncrease the efficiency of your team by automating simple requests.
Prerequisites
- An active Konfuzio account.
- A knowledge base ID (knowledgebaseId) for the Konfuzio chatbot.
- Access to Google Sheets and the ability to create custom scripts.
Set up integration: Step-by-step instructions
1. set up Google Apps Script
- Open Google Sheets and go to Extensions > Apps Scriptto open the script editor.
- Create a new script and insert the following code:
// Cache the session ID to minimize API calls
let cachedSessionId = null;
/**
* Fetches the session ID for a given knowledgebaseId.
*
* @param {string} knowledgebaseId - The ID of the knowledge base.
* @return {string} The session ID for the chatbot interaction.
*/
function getSessionId(knowledgebaseId) {
if (cachedSessionId) {
return cachedSessionId; // Return cached session ID if available
}
const url = "https://chat.konfuzio.com/api/chatbot/session/";
const headers = {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json",
"Origin": "https://chat.konfuzio.com",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0"
};
const payload = JSON.stringify({
knowledgebaseId: knowledgebaseId
});
const options = {
method: "post",
headers: headers,
payload: payload,
muteHttpExceptions: false
};
try {
const response = UrlFetchApp.fetch(url, options);
// Cache the session ID for future use
cachedSessionId = response.getContentText();
return cachedSessionId;
} catch (e) {
Logger.log(`Error fetching session ID: ${e.message}`);
throw new Error(`Failed to fetch session ID. ${e.message} Please create a ticket: konfuzio.com/support.`);
}
}
/**
* Fetches a response from the chatbot for a given query and knowledgebaseId.
*
* @param {string} query - The question or query to be asked.
* @param {string} knowledgebaseId - The ID of the knowledge base.
* @return {string} The chatbot's response.
*/
function fetchChatbotResponse(query, knowledgebaseId) {
const url = "https://chat.konfuzio.com/api/chatbot/answer/";
const payload = JSON.stringify({
sessionId: getSessionId(knowledgebaseId),
query: query
});
const headers = {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json"
};
const options = {
method: "post",
headers: headers,
payload: payload,
muteHttpExceptions: true
};
try {
const response = UrlFetchApp.fetch(url, options);
const jsonResponse = JSON.parse(response.getContentText());
return jsonResponse.response || "No answer found. Please create a ticket: konfuzio.com/support.";
} catch (e) {
Logger.log(`Error fetching chatbot response: ${e.message}`);
return `Error: ${e.message}`;
}
}
/**
* Google Sheets custom function to fetch chatbot response.
*
* @param {string} query - The question or query to be asked.
* @param {string} knowledgebaseId - The ID of the knowledge base.
* @return {string} The chatbot's response.
* @customfunction
*/
function answer(query, knowledgebaseId) {
return fetchChatbotResponse(query, knowledgebaseId);
}
function testanswer() {
answer("What is Konfuzio?","66e485c06d786fb048e7ab8a");
}- Save the script and name it e.g. as
KonfuzioChatbotIntegration.
2. prepare Google Sheets
- In a cell in Google Sheets, you can use the following custom function to retrieve a response from the Konfuzio chatbot:
=answer("Ihre Frage", "IhreWissensdatenbankID")
- For example, to ask a question like "What is Konfuzio?", use:
=answer("Was ist Konfuzio?", "66e485c06d786fb048e7ab8a")
The chatbot will answer the question based on the data in the specified knowledge base.
3. test the integration
- Execute the function
testanswer()in the script editor to ensure that the connection to your Konfuzio chatbot works and a response is delivered.
Advanced customizations
You can extend this integration to:
- Automatic reports by asking questions about performance monitoring or business metrics in Google Sheets.
- Regular updates by adding questions to your spreadsheet that are automatically answered by the chatbot on a daily or weekly basis.
Troubleshooting
If no answer is displayed by the chatbot:
- Check API authenticationMake sure that your knowledge base ID is correct.
- Check protocols: Use
Logger.log()in the script editor to identify any errors in the API connection. - Contact support: For further help, create a ticket under konfuzio.com/support.
Conclusion
The integration of Konfuzio Chat into Google Sheets allows you to integrate AI-driven responses directly into your worksheets. This allows you to further increase automation in your work and reduce manual processes. This flexible solution can be customized to your team's needs and provides a smart way to manage information efficiently.

