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

      • Bidirectional sync between Zoho Bookings and Zoho CRM - Part 1

        Hey, community members! The default integration between Zoho CRM and Zoho Bookings is unidirectional, which means that any appointments booked, rescheduled, or deleted in Zoho Bookings will be reflected in Zoho CRM. However, any modifications made to
      • Is it possible to edit placeholder text?

        In the master slides I want to make sure my templates have more meaning for the users and want to replace the standard placeholder text with something more instructional. Instead of "Click to edit Mast subtitle styles" I want to have "Click to enter reporting
      • Delay function execute

        I've got a workflow which uses a webhook to send information to Flow, which in return updates a record in Creator. Problem is, by the time this has executed, the rest of my script has run and can't find the (yet to be) updated info in the record. Is there
      • Refunds do not export from Shopify, Amazon and Esty to Zoho. And then do not go from Zoho inventory to Quickbooks.

        I have a huge hole in my accounts from refunds and the lack of synchronisation between shopify , Amazon and Etsy to Zoho ( i.e when I process a refund on shopify/ Amazon or Etsy it does not come through to Zoho) and then if I process a manual credit note/
      • How to allow download of a file AFTER information is collected?

        I can't find this anywhere. Can someone help with what seems to be a pretty basic web function today? - File is stored in Workdrive - Prospect goes to a URL where the file is located - System requests prospect to enter "Name" and "Email" - An email is
      • Email Reminders on Shared Calendars

        How do we turn off the setting that emails reminders to everyone who has accepted or declined a calendar invite? If 8 of us have been invited to the same meeting, we receive 8 notifications for every step of the process, from invitation to decision.
      • Add Baseline methods to API

        There are no API methods for creating or querying baselines,  Use case: Customer is notified of the current project start date according to plan via another product/integration. We would like to auto create a baseline (Automated via API) at the point
      • Bulk Fill In & Edit PO/Bill/SO/Invoice

        Hello, I am adding stock in bulk on a PO, the system is automatically populating the Rate (price) and Tax from the item data. Problem is that the bill rate is different from the rate on the item data, so I have to manually erase each and enter the price.
      • Fixed Assets beg balance

        Hello, I trust you are well I'm a new zoho books user and I find it difficult to plug in the fixed assets balance and here's what I have done: 1- I imported the fixed assets data into the fixed assets module as per the instructions 2- the import process
      • Syncing with Google calendar, Tasks and Events

        Is it possible to sync Zoho CRM calendar, task and events with Google Calendar's tasks and events. With the increasing adoption by many major tool suppliers to sync seamlessly with Google's offerings (for instance I use the excellent Any.do task planning
      • CRM Deluge how can link attach file with workdrive file.

        Hi, We have create file at workdrive and would like to link to attachment at crm module by deluge. Right now can only upload it to attachment but can not link the file from workdrive. Thank you
      • Feature announcement: AI-powered document generator in Zoho Sign

        Hi there! We recently announced manual document creation by offering an editor within Zoho Sign. Today, we are excited to announce AI-powered document generation to help you draft agreements, purchase orders, and other important business documents in
      • Permanently deleted files

        Is there a way to get back permanently deleted files from your account if they were accidentally deleted and no longer recoverable from the recycling bin? I know I am probably screwed but I just figured I would ask.
      • Shared Mailbox in iOS app

        Hi, On the desktop I am using a Shared mailbox for our company's general mailbox that somebody else should be able to view. In the iOS app however I can't find it? Old sources on the internet says this isn't possible but that can't be right? Somebody
      • Tip #41- Simplify Compliance and Efficiency with Zoho Assist’s Data Cleanup Feature- 'Insider Insights'

        Managing device data efficiently is just as important as securing remote access. With Zoho Assist’s Data Cleanup feature, admins can easily remove outdated or unnecessary device records, keeping the console organized and secure. This action is carried
      • Revenue Management: #6 Revenue Recognition in Professional Services Industry

        If you run a consulting firm, agency, or any service-based business, you have a situation where you have signed the contract, maybe even sent the invoice, and have received some initial payments. So, can you consider this as revenue? What if the project
      • This domain is not allowed to add. Please contact support-as@zohocorp.com for further details

        I am trying to setup the free version of Zoho Mail. When I tried to add my domain, theselfreunion.com I got the error message that is the subject of this Topic. I've read your other community forum topics, and this is NOT a free domain. So what is the
      • Zoho fsm scheduled maintenance dispatch

        Hi, I'm reaching out regarding an issue I'm encountering with the Scheduled Maintenance feature in Zoho FSM. I’m trying to configure it so that it automatically dispatches all maintenance jobs scheduled within the next 150 days, starting from today. However,
      • Template modifiactions

        Hello, I am struggling with the templates in ZOHO Books. Especially with the placement of some items, like company address, ship to, bill to etc.  For example: One item I like from template X (placement of ship to and bill to next to each other in the
      • zoho.inventory.getRecords returns no records

        I running a custom function (Deluge) in Zoho Flow with a connection to Zoho Inventory. To debug the problem, I created the test function below. It returns "Number of contacts fetched: 0". This confirms that there's no issue with the org ID or connection
      • How do I get Status History data of my Projects?

        I want to build a table in Zoho Analytics that Groups by Date, when Projects entered a certain status. I cannot find Status History or any such useful data available in the Setup of my Data Source sync. Please advise how I can achieve this?
      • Zoho Campaigns Event timestamps do not propagate to Zoho CRM

        We have integrated Zoho CRM and Zoho Campaigns. But when looking at Contact records, the Campaign event data is missing the actual timestamps: especially when a particular email was sent. They're not in the Campaigns related list, and the cannot be found
      • Feature announcement - Simplifying document creation with Zoho Sign

        Hi there, We are pleased to announce the release of our document creation feature, enabling you to create, edit, and finalize documents like agreements, purchase orders, and contracts without relying on external tools or applications. <br> This
      • Integrating File Attachments in Zoho Flow Email Notifications

        Hi, I would like to be able to send an email once an entry is made in a form, and in this email, I would like to attach a file that has been added to the form using the ImageUpload (or FileUpload) widget. So, I started by creating a flow that will trigger
      • CRM->INVENTORY, sync products as composite items

        We have a product team working in the CRM, as it’s more convenient than using Books or Inventory—especially with features like Blueprints being available. Once a product reaches a certain stage, it needs to become visible in Inventory. To achieve this,
      • Zoho Mail SMTP IP addresses

        We are using Zoho Mail and needs to whitelist IP for some redirections from your service to another e-mails. You can provide IP address list for Zohomail SMTP servers?
      • Zoho project purchases

        Hi Folks, I think having a purchase module in projects will help in putting together a project p and L. Project wise purchases and expenses.  Do let me know your thoughts.
      • Create Tasklist with Tasklist Template using API v3

        In the old API, we could mention the parameter 'task_template_id' when creating a tasklist via API to apply a tasklist template: https://www.zoho.com/projects/help/rest-api/tasklists-api.html#create-tasklist In API v3 there does not seem to be a way to
      • How can I restore all the deleted Time entries of a Task in Zoho Projects

        How can I restore all the deleted Time entries of a Task in Zoho Projects? Query: In Zoho Projects, I cloned a task and deleted the time entries from the cloned task. However, this also deleted the time entries from the original task. How can I restore
      • Is there a way to make an account inactive in ZoHo Desk

        We have a few Clients "Accounts" that we no longer do business with. It would be beneficial for them to not show up in lists. However, we want to go back and view tickets, time, etc.
      • How to set the value of the Phone field importing contacts in Zoho Desk

        Hi everyone, i'm new in Zoho Desk, we're setting up the environment and i'm importing contacts from another CRM using a file CSV and i'm getting a problem with phone numbers (italian): the leading zero is cut away, also if the value is inside double quotes.
      • Can we generate APK and IOS app?

        Dears, I want to know the availability to develop the app on zoho and after that .. generate the APK or IOS app  and after that I added them to play store or IOS store.. Is it possible to do this .. I want not to use zoho app or let my customers use it. thanks 
      • Set Custom Icon for Custom Modules in new Zoho CRM UI

      • Change total display format in weekly time logs

        Hi! Would it be possible to display the total of the value entered in the weekly time log in the same format that the user input? This could be an option in the general settings -> display daily timesheet total in XX.XX format or XX:XX.
      • Deprecation Notice: OpenAI Assistants API will be shut down on August 26, 2026

        I recieved this email from openAI what does it means for us that are using the integration and what should we do? Earlier this year, we shared our plan to deprecate the Assistants API once the Responses API reached feature parity. With the launch of Conversations,
      • How to center a field inside a section?

        I’ve been trying to center a field inside a section in Zoho Canvas. When I align it visually, it looks centered in the editor, but after clicking Save, the field appears misaligned on the actual canvas. I also tried setting the field to full width, but
      • Quick Create needs Client Script support

        As per the title. We need client scripts to apply at a Quick Create level. We enforce logic on the form to ensure data quality, automate field values, etc. However, all this is lost when a user attempts a "Quick Create". It is disappointing because, from
      • Kaizen #192 - Implementing Custom Token Persistence in Python SDK

        Welcome back to another week of Kaizen! Last week, we discussed how to implement Login with Zoho using OAuth 2.0 and saw how to bring it to life in a real-world application with the Zoho CRM Python SDK. We also discussed how Zylker Academy built a custom
      • Showing the map along with mileage expense

        When you use the GPS to track mileage, it shows you the map of the actual path travelled. It would be very useful and practical to save that map with the mileage expense, so that when the report is created, it provides a map of each mileage expense associated
      • Is there any way to recall an email sent using Zoho CRM?

        If an email is sent using Zoho Mail, there is a recall option/functionality that is available to the sender. Is there any way to recall an email if it was sent using Zoho CRM? I can't seem to find that option. Any help would be appreciated.
      • Next Page