Hello everyone,
Greetings from Deluge! It's been a while since we connected, but now we're back in action, continuing our series of posts on Zoho services that support Deluge. We hope you found the
previous post in this series useful. In today's post, let's explore the ways in which you can use Deluge to achieve more with Zoho Sheet.
Custom functions is the
Zoho Sheet feature that uses
Deluge. These functions are written using the Deluge scripting language to manipulate data more effectively, communicate with third-party applications, and fetch/update values based on your requirements. Custom functions enable you to program your own functions and add different types of business logic. Apart from
creating and running custom functions using Deluge,
Zoho Sheet also allows bringing in data from other Zoho or third-party services using connections. Integrating with other services requires you to create a connection, thereby ensuring data transfer between the connected services.
Many organizations have their own business logic that requires personalized functions. For example:
- Let's say you've maintained inventory stock details in the Item Details report inside your Zoho Books account. As prices keep fluctuating everyday, it could become frustrating and tedious to individually edit and update each record in your report. To resolve this, you can maintain the required data in your Zoho Sheet. You can achieve data synchronization between both the services by configuring a custom function that performs the following actions via API calls.
- Pulls the required data from the Item Details report in your Books account and populates the same in your sheet.
- Pushes data to the Item Details report in Books as and when data is created/edited in your sheet.
This way the data in your Books report will be automatically updated each time you add new data to your sheet.
- Let's say you've collected and stored the feedback comments of your customers in your sheet. You need to analyze the sentiments of these comments, categorize them as — Positive, Negative, and Neutral and submit the final sheet to the appropriate authority. To achieve this, you can create a custom function using zoho.ai.analyseSentiment task. The function checks a comment, analyzes its emotion and returns the detected emotion along with its probability percentage.
Example
Let's say you own a business named Zylker Corp. Your business has clinched a good number of sales-ready deals in the current year. But handling a large number of deals every day makes it difficult to determine which ones to focus on.
You're in charge of tracking and maintaining these deals, and you need to fetch all of them, along with their relevant details, such as Deal Name, Amount, and Closing Date for a certain period, and then populate that data inside your sheet.
This data is useful in generating real revenue for your business. However, this is time-consuming if done manually, and can also lead to errors. To overcome this, Deluge can be used to create custom functions that can actually pull data from your Deals module inside Zoho CRM.
Note: To use custom functions that require fetching data from other services (in this case, we're fetching data from Zoho CRM and populating them in Zoho Sheet), the owner of the spreadsheet must hold an account in Zoho CRM.
These custom functions are similar to the macros in an Excel sheet. A macro is an action or set of actions that you can run as many times as you want. If you have tasks in Microsoft Excel that you repeatedly perform, you can create a macro to automate those tasks.
Similarly, you can create a custom function by specifying set criteria and running it repeatedly whenever required. In other words, you can automate repetitive tasks using custom functions to save time and manual effort.
How it works
Steps to create a custom function
1. Create connection
- Navigate to Tools > Custom Functions and click Manage Connections.
- Click Create Connection. Select the Default Services tab under Pick Your Service.
- Select the Zoho OAuth service from the list of services.
- Enter a suitable Connection Name. Here, we named it crm_oauth_connection. The Connection Link Name will be auto-filled accordingly.
- Choose scopes ZohoCRM.coql.READ and ZohoCRM.modules.deals.ALL.
Note: - This connection is used to authorize Zoho CRM to fetch records from all its modules through a COQL query.
- We're using the COQL API here, since selecting a date range in the function's criteria isn't supported in the Get Records API.
- Refer to the API page to learn how to get records through a COQL query.
- Click Create and Connect. You'll be redirected to the service authentication page.
- Click Connect, then click Accept to allow DRE to access data in your Zoho account. The required connection is now created.
- The CONNECTION SUMMARY page will display your connection details.
2. Create custom function
- Navigate to Tools > Custom Functions and click Create Custom Function.
- Enter a valid function name.
- Select the data type of the return value for the specific function to be created from the Result Type dropdown. Here, you need to choose list as the return data type, since we need the output to be displayed as a list of values (vertically).
- You can also add the required arguments and their types for the function in the Create Custom Function popup. Here, you must add the following arguments—StartDate and EndDate—with their data types as date. This is because we're going to fetch the deal details between the specified start and end dates.
- Click Create and your custom function will be created.
3. Script using Deluge
- Navigate to Tools > Custom functions > View Deluge Editor.
- Select the added custom function (DEALS_BETWEEN), write the following script in the editor, and click Save.
- //List is the return data type. StartDate and EndDate are the parameters, whose values will, in turn, be supplied as params while making the CRM API call.
- list DEALS_BETWEEN(date StartDate, date EndDate)
- {
- //Use toString to convert the input dates to accepted date formats in Sheet.
- start_date = StartDate.toString("yyyy-MM-dd");
- end_date = EndDate.toString("yyyy-MM-dd");
- //Construct a map with the required deal details in the defined map variable using a select query. The deal details include field names from the Deals module in CRM.
- query_map = Map();
- query_map.put("select_query","select Deal_Name, Amount, Closing_Date from Deals where Closing_Date between '" + start_date + "' and '" + end_date + "'");
- //Invoke the Zoho CRM API to fetch the records from the Deals module through a COQL query. The connection you created earlier will be used here.
- response = invokeurl
- [
- url: "https://www.zohoapis.com/crm/v3/coql"
- type: POST
- parameters:query_map.toString()
- connection:"crm_oauth_connection"
- ];
- //resultList is the variable to declare a list.
- resultList = List();
- response_data = response.get("data");
- //The below "for" statement parses the records inside the Deals module and fetches the specified details
- for each record in response_data
- {
- resultMap = Map();
- resultMap.put("Deal Name",record.get("Deal_Name"));
- resultMap.put("Amount",record.get("Amount"));
- resultMap.put("Closing Date",record.get("Closing_Date"));
- resultList.add(resultMap);
- }
- //Returns the response in the format expected by Zoho Sheet.
- return resultList;
- }
Note:
- In the above script, Deal_Name, Amount, and Closing_Date are API names of fields in the Zoho CRM Deals module.
- You can test your custom function by clicking Run and entering sample values.
If you want to get the required API names for other CRM fields:
Log in to your CRM account.
Navigate to Settings > APIs (under Developer Space) > CRM API > API names.
Click the Deals module. The API names page will list the API names of all the fields in the Deals module.
You can then use the required API names in your script.
4. Execute function
Enter the function in the below format. Your sheet will be populated with the deal details (Deal Name, Amount, and Closing Date) between the specified time period.
Input format:
=DEALS_BETWEEN("2022-01-01";"2022-11-11")
where,
DEALS_BETWEEN | name of your custom function |
2022-01-01 | start_date value |
2022-11-11 | end_date value |
You can refer to
help page to learn in-depth about how to achieve the above custom functions using
Deluge in Zoho Sheets.
We hope you found this post useful—we'll be exploring
Deluge in Zoho Connect in our next post. Please let us know if you have any questions, feedback, or suggestions in the comments, or write to us at
support@zohodeluge.com.
Thank you!
You can also check out our preview posts in this series!
Recent Topics
In ZohoCRM Dashboards - Editing Shown Columns on Drilldown of Components
Hello! I'm working with some Dashboards inside of ZohoCRM. When creating a component (In this case, specifically a KPI Ranking Component), I'd like to customize which fields show when trying to drilldown. For example, when I click on one of the sales
Added Domain but SSL is not being set properly
We added a Domain for our landing page and it pushed an SSL cert to it. The Cert is generated by LetsEncrypt, but it doesn't match our subdomain (i.e., it's just pointing to zohosites.com). How do we get the cert properly setup there?
Zoho CRM Widget not displaying 2 related lists (JS)
Okay so I basically have 2 relatedLists that I want to get and render: ZOHO.CRM.API.getRelatedRecords({ Entity: data.Entity, RecordID: data.EntityId, RelatedList: "Notes", page: 1, per_page: 200, }) ZOHO.CRM.API.getRelatedRecords({ Entity: data.Entity,
KPI widget with percentage
I'm trying to create a KPM widget that displays current performance as a percentage - something like the picture below. I've tried following the instructions at https://www.zoho.com/analytics/help/dashboard/kpi-widgets.html#chart but nothing ends up being
Canvas List View Not Saving
Hi, I am trying to edit a list view to look different depending on the tags. Everything worked well and saved well with multiple views, but when I have gone back in to make some small changes like moving one of the icons it comes up with the error message
Team Inbox is not working AGAIN
I like Team Inbox in general. It makes using a collaborative inbox easy - when it works. The problem is that it doesn't work at times - and it seems to not work, a lot. It's not catastrophic failure, it's little things. Unable to send messages Unable
QR code image is not exported in PDFs
The new QR code field works fine when I include it in a report template and I choose the print option: https://creatorapp.zoho.com/<username>/<app_link_name>/record-print/<report_link_name>/<record_ID>/ But when I try to save the document to a .pdf file
QR codes in templates
I'm excited about the new QR code generator. I have included a QR code that contains the record ID setting "${ID}" as input data. In the report detail it works perfectly but when printing it in a template the code is not shown.
This mobile number has been marked spam. Please contact support.
Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
geographic search filter in map view
Hi, I have a recruiting and timesheet system built in Creator. The client wants to enhance the search for candidates based on their location and filter by job skills - currently they look on the Map View which uses the geo location or post code of the
Zoho CRM search not working
The search bar is not showing any results in our CRM installation. We have a lot of items and can not search them by using the navigation each time. Can someone please check this asap.
Reload page with widget
Hi all, I hope I can find some help here. I developed a small widget for Creator that is integrated into a page as a component. The page contains other content as well. When the widget is sent, the entire page should be reloaded to apply the changes to
Tip of the week #37 - Manage all your Telegram business conversations directly from your shared inboxes.
Tired of switching between multiple apps to manage your business conversations? With Zoho TeamInbox's multichannel inboxes, connect your Telegram channel to a shared inbox. This way, your teams can easily handle c View, reply, and collaborate on them
Tags on notes aren't syncing correctly on Android
I've created notes on the desktop version that have several tags assigned, but on both my Android devices those notes only have ONE of those tags instead of all of them, despite the actual content of the note being correctly synced, and I'm also starting
Reports - custom layout - duplicate report
Do you also have this problem and what is the possible solution? I duplicate a report that has a "custom layout". Unfortunately the custom layout is not duplicated. To be improved for a future release by Zoho. I export the custom layout and import it...
How to map a global picklist from one module to another
Hi there, i currently have a new field that is called sales office which we use for permission settings between our different offices located in different countries. It is a global set picklist with three different options: MY, SG and VN. I want to be
Pageless mode needed to modernise Writer
When we switched from GSuite to Zoho, one of the easiest apps I found to give up, was Docs. In many ways, Writer has always been more powerful than Docs, especially in terms of workflows/fillable forms/etc. However, I went back into Docs because I notice
Changing the Logo Size on Zoho Sites
My company logo incorporates both an image and text, and I would like it to be much more prominent on the page than is currently allowed by the small logo box in the template. Is there any way to hide the page name and then make the logo box much bigger since my company name and logo are connected / are all in one file? Thank you.
Is it possible to Select Item Serial Numbers from a Sales Order?
Our accepted estimates are converted to Sales orders for our warehouse staff to pick. How can my warehouse staff select the serial numbers for an item when editing a Sales Order? Logically when staff pull an item and have the serial in front of them they update the Sales Order and select the serial. I understand a serial can be added when creating an invoice but how can accounts team know the serial if the warehouse staff can't select it! A basic flaw!
MORE BUGS: Client Script, Deluge and Widget JS SDK don't work as expected when trying to retrieve a record that has been "rejected" as part of an approval process.
Client Script $Page.record is null when accessing a record that has been "rejected" as part of an approval process. Deluge zoho.crm.getRecordById(moduleName, recordId) returns {"status":"failure"} when recordId is a valid, but rejected record. OK... I
Zoho CRM Widget not displaying 2 related lists (JS)
Okay so I basically have 2 relatedLists that I want to get and render: ZOHO.CRM.API.getRelatedRecords({ Entity: data.Entity, RecordID: data.EntityId, RelatedList: "Notes", page: 1, per_page: 200, }) ZOHO.CRM.API.getRelatedRecords({ Entity: data.Entity,
Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps
We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
Zoho Books and Zoho Projects Task Status Update
How can we create an automation using custom functions for the following scenario. When our zoho books invoice status changes to paid. I want a task in Zoho projects to change to completed.
Different content per social media account..
Is there a way to add different content per social media account on one post?
Assigning Tasks and Requests to Groups... how do I?
Guys, I've spent many hours exploring Zoho Support and we are generally satisfied with the system. I'm trying to understand how a system that has so much to offer can be missing GROUP assignment and queue functionality. I am hoping that there is a way
Parsing of SQL query failed. Please check the SQL syntax.
I am trying to have Zoho Analytics recognize that if the a Deal is in Stage "Need Docs" it should also be counted as a Deal in the Stage "New Lead" /*New Lead*/ SELECT "ID" 'New Lead' AS "Stage" From "Deals" Where "Stage" = 'Need Docs' Union All Error
Where is the setting to enable/disable 2FA?
The following links show where enable/disable 2FA is supposed to appear, but neither appear for me: https://help.zoho.com/portal/en/kb/zohosites/faq/account/articles/how-do-i-enable-or-disable-two-factor-authentication-for-my-account shows Security >
How to Assign Record Ownership in a Custom Form via API?
Hello everyone, I’ve created a custom form in Zoho People and I’m using the API to manage its records. I would like to know how I can assign ownership of these records to specific users via the API. Is there a specific parameter or field in the API request
Customer Statement Template not matching when sending
Hi everyone! So when I send statements to our customers via Zoho Books, the message that appears by default does not match what I have written on the template Under settings -> email notifications -> sales -> customer statement We have a single default
Working with keywords
Hello everyone, first time here so I will try to be brief. I am working on my company's data set. I have a table with all the images we have on line. For each image we hava a cell tha contains all keywords related to that image. I would like to explore
Unlocking New Horizons: A Year in Review
As we bid farewell to 2024, let's celebrate and revisit the key highlights of the year. From adding a new edition to cross-platform enhancements, here’s a roundup of all the feature updates designed to simplify accounting, optimize financial management,
Peppol Malaysia API
Hi Zoho Books, my country Malaysia will going to implement "Peppol" (E-Invoicing), starting 1 Jul 2025 for all businesses. The government intends to provide API for accounting app. The workflow involves creating an invoice from accounting app, triggers
Re-emitir facturas con nueva dirección de facturación
Hola, necesito saber si es posible que las facturas ya emitidas, pueden ser re-emitidas con el cambio de dirección de facturación, realizado el día de hoy 02-01-2025, para efectos contables. Espero su ayuda, Gracias
Zoho Learn vs. Trainer Central
Hi, I'm currently using Zoho One with a WordPress-based website and WooCommerce to manage my online courses. I would like to know what is the difference between Zoho Learn and Trainer Central and if it's possible for these two platforms to replace WP
Map Plan to Different Income Account for Some Subscriptions via API
We have a plan that has a default Plan Account of "Sales". Can we override the account for a specific subscription via API? In some instances the same exact plan should map to a different income account. When we create stand-alone invoices in Zoho Books,
Flow with CRM
Hello, I have a simple flow that uses a web hook to enter data into a Sales Order. I have the web hook sending Flow data which has a PO field. If the PO has a special character like - or / or \ the task fails. How can I get the flow to be okay with the
We've revised the pricing model of CRM portal user licenses
Hello everyone, We’re making important updates to our pricing structure for portal user licenses, effective from the next payment cycle. The new slab-based pricing is as follows: Previously, these portal user licenses were priced at $5/ user/ month. As
Chrome browser issues. Anyone else?
I am suddenly having multiple issues with Chrome browser interpreting the Zoho Mail interface. Anyone else? Any known problems? Thanks, Todd
Set another Layout as Standard
We created a few layouts and we want to set another one to standard:
Zoho Payroll US?
Good morning, just reaching out today to see if there's any timeline, or if there's progress being made to bring Zoho Payroll out to be available to all states within the USA. Currently we're going through testing with zoho, and are having issues when
Next Page