Plug Sample #5 - Read and write values/data in a Google Sheet with Zobot

Plug Sample #5 - Read and write values/data in a Google Sheet with Zobot

We all know google sheets are one of the widely used spreadsheet software. It helps us to make data-driven decisions. When connecting the Zobot with sheets, the bot can display values/data from a spreadsheet, like the available stock details (Item price, quantity). Create a new record, such as feedback, comments or even update the existing fields based on your requirement. In this post, we will focus on using plugs to achieve the below google sheets actions with REST API. 
  • Fetching records from Google sheets
  • Creating records in Google sheets
As we're aware, Plugs in the Codeless bot builder are used to create custom actions or third-party integrations using deluge. You can create a plug and add it as a card in the bot builder, like rest cards. Now let's learn how to create this plug step by step. 
 
Step 1 - Creating a connection with Google service.   
  • In your SalesIQ Dashboard, navigate to Settings > Developers > Plugs > Click on Add.
  • Provide your plug a name, and description, select the Platform as SalesIQ Scripts, and finally, click on Connection to your left bottom. You will be redirected to the connection interface. 

  •  Click on Create connection at the top right corner. Under Default connection, select Google service. 


  • Click on Create And Connect. Upon successful authentication,  Zoho SalesIQ will be connected with the Google service. 
Note: The Connection Link Name is used to scripts to invoke URL tasks.
 

 
Step 2 - Create the plug using Connection:
 
First let's look at fetching records from Google sheets. Any data that is available in sheets can be fetched. For example, if you're running an e-commerce business and maintaining all the stock information such as item name, quantity, price etc. on sheet, those details can be fetched here and displayed to the visitor. 
  • Copy, paste the below code and changes the sheet ID, name, row range, and connection name. 
  1. //Add a output parameter named "allproducts" and select "Option list" as datatype
  2. google_spreadsheet_id = "1y92rI_ITWLxpXOQMtyO8W9_7P6HwygxfneeVxdoRd-E";
  3. sheet_name = "Fetching+records";
  4. //specify the correct range like "a1:b11"
  5. url = "https://sheets.googleapis.com/v4/spreadsheets/" + google_spreadsheet_id + "/values/" + sheet_name + "!a2:b11?majorDimension=ROWS";
  6. //googlesheets - Connection link name made using the connection interface (Step 1)
  7. apiresponse = invokeurl
  8. [
  9. url :url
  10. type :GET
  11. connection:"googlesheets"
  12. ];
  13. values = apiresponse.get("values");
  14. productList = List();
  15. //Adding all the product and ID in an option list | Ref - https://www.zoho.com/salesiq/help/developer-section/plugs-datatype-optionlist.html
  16. for each  entry in values
  17. {
  18. id = entry.get("0");
  19. product = entry.get("1");
  20. productList.add({"id":id,"text":product});
  21. info productList;
  22. }
  23. response = Map();
  24. //parasing the plug output 
  25. // allproducts - Name of output parameter; productList - Value to be associated to "allproducts"
  26. response.put("allproducts",productList);
  27. return response;
  • Then, click save, preview the plug and publish it. For your reference, we have made the sheet public.
Note: API invoked in the plug spreadsheets.values.get API


  • The above reference shows the spreadsheet ID and the sheet name.
Now, let's look at creating records in Google sheets. Any type of data can be pushed to sheets, such as feedback, comments, etc. 
  •  Copy, paste the below code and change the sheet ID, name, and connection name.
  1. //Add two input parameters named "visitorID","feedback" and select the datatype as "String"
  2. if(session.containsKey("visitorID"))
  3. {
  4. id = session.get("visitorID").get("value");
  5. }
  6. if(session.containsKey("feedback"))
  7. {
  8. feedback = session.get("feedback").get("value");
  9. }
  10. google_spreadsheet_id = "1y92rI_ITWLxpXOQMtyO8W9_7P6HwygxfneeVxdoRd-E";
  11. sheet_name = "Create+records";
  12. //specify the correct range like "A3:B3"
  13. url = "https://sheets.googleapis.com/v4/spreadsheets/" + google_spreadsheet_id + "/values/" + sheet_name + "!A3:B3:append?valueInputOption=USER_ENTERED";
  14. params = {"majorDimension":"ROWS","values":{{id,feedback}}};
  15. apiresponse = invokeurl
  16. [
  17. url :url
  18. type :post
  19. parameters:params.toString()
  20. headers:{"Content-Type":"application/json"}
  21. connection:"googlesheets"
  22. ];
  23. info apiresponse;
  24. response = Map();
  25. return response;
  • Then, click Save, preview the plug and Publish it. For your reference, we have made the sheet public
Note: API invoked in the plug spreadsheets.values.append
 
  •  Navigate to Settings > Bot > Add, provide the necessary information, and select Codeless Bot Builder as a bot platform or open an existing bot.
  •  Select the Plugs under Action Card and select the required plug (Only published plugs will be listed here)
  •  Provide the plug inputs and outputs.
  •  Click Save


In the above video, we've used a plug, fetched some products and displayed them as options to the visitor. 
 
Heads up:
Related links:
To know more about the features of Zobot, kindly visit our Resources Section. 

Best regards,
Sasidar Thandapani



        • Recent Topics

        • Is it possible to customize ZC Themes?

          I understand you can choose a layout and customize Brand Color, App Header, Menu, and Sub-Menu components, but can you override some of the default theme settings with CSS or a config file? For example, - Table highlight color - Listview auto filter highlight
        • Is it possible to create Custom function-based Lookup field in Zoho CRM

          Is it possible to create a custom function-based lookup field in Zoho CRM? If so, how? Use case: Need to fetch users from Zoho Projects into a dropdown field in Zoho CRM.
        • @mention in comments no notification

          Hi, hope someone can help. When we @mention someone in the comments in Zoho Creator, how is that user notifed as we don't get anything on email or in the app notifications. 
        • Add "Running Balance" column to Account Transaction Reports

          Hello, Currently Zoho Account Transaction Reports give you the opening balance, then lists the transactions, then provides the closing balance.  It would be great if you could add a column on the far right that shows the "Running Balance" on the account after each transaction.  There are many times when analyzing or tie-ing out transactions that this would be very helpful.  I currently have to frequently run a tape on my adding machine to get balance totals after a specific transaction on the list.
        • Unified customer portal login

          As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
        • WhatsApp Channels in Zoho Campaigns

          Now that Meta has opened WhatsApp Channels globally, will you add it to Zoho Campaigns? It's another top channel for marketing communications as email and SMS. Thanks.
        • error : Object code : 6500

          b3 = map(); b3.put("name", "Test Project Name"); updateprojects2 = invokeurl [ url :"https://projectsapi.zoho.eu/restapi/portal/era0130/projects/169495000000928007/" type :PUT parameters: b3 connection:"in2" ]; info b3 ; info updateprojects2; ------------
        • I got unknown charge from Zoho

          Good day, I need help disputing a charge I don't know from, zoho. I have ZohoMail and ZeptoMail. I purchase credits for ZeptoMail, and for ZohoMail I am not subcribed.
        • How can I see content of system generated mails from zBooks?

          System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
        • Zadarma + Zoho CRM Integration – Missed Calls Saved as Contacts Instead of Leads

          Hello everyone, I’m looking for input from anyone with experience using the Zadarma + Zoho CRM integration. Currently, I’m seeing that missed calls are automatically being created as Contacts instead of Leads. From a CRM perspective, this doesn’t make
        • Function 56: Automatically enable the option for customers to pay via bank account

          Hello everyone and welcome back to our series! One of the key features of Zoho Books is its integration with multiple payment gateways, allowing you to receive online payments for your invoices. This ensures faster payments, automates payment tracking
        • Attach Files to Your Notecards and share them on the go!

          Hey everyone! We’re excited to share a feature many of you have been asking for — you can now attach files directly to your text notecards and share with ease! 🙌 This update was built with your feedback in mind, especially for those who wanted a simple
        • Can i connect 2 instagram accounts to 1 brand?

          Can i connect 2 instagram accounts to 1 brand? Or Do i need to create 2 brands for that? also under what subscription package will this apply?
        • Workdrive on Android - Gallery Photo Backups

          Hello, Is there any way of backing up the photos on my android phone directly to a specific folder on Workdrive? Assuming i have the workdrive app installed on the phone in question. Emma
        • Integración Books para cumplir la ley Crea y Crece y Ley Antifraude (VeriFactu)

          Hola: En principio, en julio de 2025, entra en vigor la ley Crea y Crece y Ley Antifraude (VeriFactu). ¿Sabéis si Zoho va a cumplir con la ley para cumplir con la facturación electrónica conectada a Hacienda? Gracias
        • YouTube Live #1: AI-powered agreement management with Zia and Zoho Sign

          Hi there! We're excited to announce Zoho Sign’s first YouTube live series, where you can catch the latest updates and interact with our Zoho Sign experts, pose questions, and discover lesser-known features. We're starting off by riding the AI wave in
        • How to add a % Growth column for year-over-year comparison (2024 vs 2025)

          Hello, I am trying to build a monthly revenue comparison between 2024 and 2025 in Zoho CRM Analytics. My current setup is: Module: Deals (Affaires) Filter: Stage = Closed Won Date field: Closing Date Grouping: By Month Metrics: Sum of Amount for 2024,
        • How to searchByCriteria records that are under approval?

          I need to search for both approved and pending approval records Is that possible with this method? Or I need to a different method? var priceReqID = $Page.record_id; log(priceReqID); var records = ZDK.Apps.CRM.Price_List_Item.searchByCriteria("Price_Request:equals:"
        • Power of Automation::Streamline log hours to work hours upon task completion.

          Hello Everyone, A Custom Function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as to when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:-
        • How to add Simple Analytics to Zoho Pages?

          I have a website with Zoho Pages, how do I add Simple Analytics on it? They seem to have code they need to be embedded https://docs.simpleanalytics.com/script
        • End Date in Zoho Bookings

          When I give my appointments a 30 minutes time I would expect the software not to even show the End Time.  But it actually makes the user pick an End Time.  Did I just miss a setting?  
        • Cant seem to delete an email account

          Hello, I have researching for 4 days how to delete an email account and I am absolutely without a clue. The email account I am trying to delete is support<AT>fyshoes<dot>com. It's the first email account I made and it (is???) was associated with the super user (me). I have since changed it to adming<AT>fychoes<dot>com and I see the support email in my list but I just cant seem to get rid of it. Ultimately I want to associate that email account with another user that I want to add. This is really
        • Commerce Order as Invoice instead of Sales Order?

          I need a purchase made on my Commerce Site to result in an Invoice for services instead of a Sales Order that will be pushed to Books. My customers don't pay until I after I add some details to their transaction. Can I change the settings to make this
        • Import data into Multi-Select lookup field from CSV/Excel

          How to import data into a multi-select lookup field from the CSV/Excel Sheet? Let's say I have an Accounts multi-select lookup field in the Deals module and I want to import the Deals with Accounts field. Steps:- 1. Create/edit a multi-select lookup field
        • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

          Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
        • Script that deletes a record?

          We're using WP Plugin "Integration for WooCommerce and Zoho Pro", and have created a couple of Feeds to send data to Zoho. We are trying to create Contact records, but only based upon condition. Tried to make it with small Deluge function and Workflow,
        • A formula that capitalises the first letter of each word

          Hi all, is there a zoho formula that can capitalise the first letter of each word in a string? INITCAP only capitalises the first letter of the first word.
        • Reverse payment on accidentally closed invoice.

          An invoice was closed accidentally with the full payment added. However, only partial payment was paid. How can I reopen the invoice and reverse this to update it to show partial payment?
        • Quotes in Commerce?

          In Zoho Ecommerce, I need to be able to generate quotes, negotiate with customers, and then generate invoices. Currently, I plan to integrate Zoho CRM to generate quotes. After negotiation and confirmation, I will push the details to Zoho Ecommerce to
        • Zoho Commerce - Mobile Application

          Does Zoho Commerce have a mobile application for customers to place an order?
        • Register user through Phone Number by Generating OTP

          In zoho commerce , I am developing website on online food store Inilialy the user get verification code to their email for registering there account for login. But I need to login using phone number by generating OTP automatically rather than verification
        • Custom Buttons for Mass Actions

          Hello everyone, We’ve just made Custom Buttons in Zoho Recruit even more powerful! You can now create Bulk Action Buttons that let you perform actions on multiple records at once, directly from the List View. What’s new? Until now, custom buttons were
        • Zoho Vault Passwords

          Is there a way to consume Zoho Vault Manager passwords using the API? Thanks in advance.
        • Is the ChatGPT Assistant integration capable of recognizing WhatsApp voice messages?

          I was wondering: if a visitor sends me a voice message on WhatsApp, would the assistant be able to transcribe it and reply to them?
        • Zoho Creator to Zoho CRM Images

          Right now, I am trying to setup a Notes form within Zoho Creator. This Notes will note the Note section under Accounts > Selected Account. Right now, I use Zoho Flow to push the notes and it works just fine, with text only. Images do not get sent (there
        • 【Zoho CRM】レポート機能のアップデート

          ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中から、レポート機能のアップデートをご紹介します。 目次 1. レポートのエクスポート時のレコードIDの表示について 2. 通貨項目の表示について 3. レポートの削除の監査ログへの反映について 1. レポートのエクスポート時のレコードIDの表示について これまで、レポートをエクスポートするとファイルにレコードIDが必ず含まれていました。レコードIDが識別子として役立つ場合もありますが、実際には多くの企業で参照されることはありません。
        • Translation in zoho bookings

          We cant translate zoho booking emails. The general text we can change. But what about text like: ""Here a link to join the meeting online:"" and "Add to Zoho Calendar" and "Add to Google Calendar"? No professional business have mixed languages. Its looking
        • Is there any way to bill one client in different currencies on different invoices?

          I have some customers who have their currency set as USD and most of their billing is done in USD.   However, from time to time I have a need to bill them in my base currency GBP for some specific invoices, but there seems to be no way of doing this that I can see. The only workaround that I can see is to create two client records for the same client, one for USD billing and one for GBP billing, but this is not an ideal situation. Is it likely that the (hopefully!) soon to arrive multi-currency support
        • API name for all fields in Zoho Project (Standard or custom)

          Hi! I struggle to find easily all API name of all field in Zoho Project to build my API rest with other services. We can find them very fast in CRM but not in PRoject.   Could you share a function to get the list of all API Name of any field of an App
        • Elevate your CX delivery using CommandCenter 2.0: Simplified builder; seamless orchestration

          Most businesses want to create memorable customer experiences—but they often find it hard to keep them smooth, especially as they grow. To achieve a state of flow across their processes, teams often stitch together a series of automations using Workflow
        • Next Page