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
Assistance with Custom Attendance Report in Zoho People
Hi, I created a custom report in Zoho People 5.0 to track employee attendance according to our specific needs, as the existing reports do not include all the required details. However, I’ve noticed that the report doesn’t update continuously or on a daily
Zoho analyticsでのタブを跨いだ集計
Zoho analyticsまたはCRMレポートなどを用いて、 見込み客タブと商談タブで共通するユニークキー(リード管理番号)を軸に、「共通選択リスト」で設定した項目別の集計を行うことは可能でしょうか? ・要望 ①リード管理番号をキーに、見込み客テーブルと商談テーブルを結合したRAWデータを作成したい ②具体的には下記表のように「共通選択リスト」項目(サービス)別のマーケ数値を一表にしたい ※リード=見込み客タブ 商談・成約=商談タブ リード数 商談数 成約数 サービスA 10 5 2
Key Highlights of 2024: Recalling a Year of Progress and Advancements!
As we step into 2025, we’re excited to share the progress and developments we’ve made to simplify and streamline your travel and expense management in the past year. Let’s take a look back at some of the key updates and enhancements that have helped us
How to refresh the page by widget in related list?
Hello, ZOHO.CRM.UI.Popup.closeReload method does the thing I need. But in my case, I'm not using popup. I have a widget in related list and I want to refresh the page when I'm done with it. I searched for it but I wasn't able to find it. Is there an any
your phone line in the uk doesnt work i need help now
i need to speak with customer service urgently
Top Menu Disappeared from Blog Page
Hi, Our top menu disappeared at Blog Posts page. However, it's still visible any other page on the website. I attached two screenshots, so it can be understood clearly. How can we bring back top menu? Thanks, K.
Missing phone numbers
yesterday I have noticed that most contacts' phone numbers are missing. At first I thought it is a synchronisation problem with my Android phone but as I have found later, numbers are missing on Zoho. I have tried to reimport contacts from a backup but
Customise 404 page in Zoho Sites 2.0
Is it possible to customise the 404 page in Zoho Sites 2? You use to create a new 404 page and that became the default 404 page, but this does not seem to work anymore? Any pointers/suggestions/support appreciated :)
[Important announcement] Zoho Writer will mandate DKIM configuration for automation users
Hi all, Effective Dec. 31, 2024, configuring DKIM for From addresses will be mandatory to send emails via Zoho Writer. DKIM configuration allows recipient email servers to identify your emails as valid and not spam. Emails sent from domains without DKIM
Create workflow rules based on notes
Last modified on 17/04/2023: Creating Workflow rules based on notes is now available for all Zoho CRM users in all DCs. Note that it was an early access feature available only upon request. As of April 13, 2023, it is rolled out for al Zoho CRM accounts.
Workflow sync between zoho books and zoho inventory
Hello, While the custom fields, validation rules and even custom buttons are sync'd between zoho books and zoho inventory, the workflow rules do not. Not sure if this is an intentional purpose of zoho team for some good reason or if it's in the development
Item sales account via api
Hey everyone, I’m making an invoice using the create invoice endpoint on the api. Is it possible to set a sales account in the line_items attributes?
Zoho Please change your ways
I started using Your new Zoho bookings in earnest 3 days ago. What a mistake. Once again, everything is backwards and upside down. I had to spend 5 hours testing how the thing works in order for me to understand how to acutally use it. When i started using google calendar years ago. it took seconds to figure out how it works. Why is that. bc they put everything in places where it makes sense. Today, I needed to add an appointment as well as a time off. Stupid me i added the time off first,
Make a ticket visible in the Community
Hi there, It is possible to have a conversation with a customer via a ticket and eventually the proposed solution isn't possible yet. Therefore you want to add it as an idea in the Community, available and open to everyone that is in the community, so
Zoho email folders gone
Hi, All my email folders are gone, i cant found any email, except sent. Also before folder rulesas was changed and i didnt fixed them, could you please check it?
Pause/Resume Subscrtiption API
I don't see the option to Pause/Resume a subscription using the API, is it in the pipeline?
Update Department on Ticket (with applied Blueprint)
Hello, Is it possible to update the Department of a ticket which is dictated by a blueprint, e.g. I would like to change departments at different states in the Blueprint. I do not see this is an option in workflow rules or blueprint transition actions,
ERROR_CODE :554, ERROR_CODE :rejected due to spam
Please verify bounce message: This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. xxx@thalesesec.com Error, ERROR_CODE :554, ERROR_CODE
Can't verify domain with AWS Route53
I have a domain successfully transferred to AWS Route53 from NameCheap. When I try to CNAME or TXT Records as suggested, they are added in AWS console however zohomail does not verify them. For the TXT record zohomail says the value is wrong, whereas
Sent emails not going and showing "Processing"
Hello Team, Could you please assist with sent emails showing "processing" and not actually going through? Many thanks and regards, Cycology
LinkedIn verification link and otp not receiving
For the last 2 to 3 weeks I'm trying to verify my LinkedIn account to access my company's LinkedIn page, Linkedin is sending verification links and codes to this email address but I have not received any codes or links. Please help me here. Looking forward
send file to ftp or another external service
i'v created a zoho creator application for take a picture and rename it by phone. Now i need to send Each renamed pictures to my ftp or to specific folder on google drive...then, delete it from creator. (every picture recived it will processed by another program and stored on my Erp) HOW CAN I DO ??
Mass pdfs into OCR field
I am working on a Creator app that my org will use internally. Is there any way to mass upload pfs through a form with an OCR file upload field? Is Creator capable of this, or would I need to use Catalyst?
How to upload a file to form file upload field from deluge script.
Hi guys, I need to store API response into Form File upload field . I'm not getting any errors but PDF file is not assigned to file upload field. You can check possibilities using below details: Method: POST URL: https://v2.convertapi.com/convert/web/to/pdf?Secret=<<SecretKey>>&Token=<<APIKey>>&Url=https://www.google.com You need to generate secretKey and APIKey by Login to https://www.convertapi.com/a/su Response: { "ConversionCost": 4, "Files": { "FileName": "www_google_com.pdf", "FileSize": 68342,
Export view via deluge.
Hi, Is it possible to export a view (as a spreadsheet) via deluge? I would like to be able to export a view as a spreadsheet when a user clicks a button. Thanks
Subform Time field showing as null in script.
Good Afternoon everyone. I am trying to take the information from my subform and populate it into a multiline field in the CRM. The code below works with no errors. The problem is, it shows that the Open and Close (Time fields) are null. But they are
Is there a way to sort report on record template by a specific field like date field
Hi, Is it possible to sort the report on the record template by the date field and not the default Added Time. Please check the example bellow: The records are sorting by the added time I wand to change that by the date field,
Shared subfolders
Am I right in thinking that there is no Zoho email application that allows me to create a shared inbox and then add additional folders/subfolders under that inbox? If so, this is really quite incredible and probably a deal breaker for us to start using
Update Multi select field values to another form table as individual record
Hi, I am new to coding and do basics within deluge. I need help with the deluge script to meet the following requirement. Form Student Attendance The fields are : Attendance Date Course (Lookup to Course Form) Class (Lookup to Class Form) Students (Multi
Shared Mailbox - Mark as read for all users
Hi all, Maybe someone can help me out. At the moment we have a shared mailbox without streams. When a users reads an mail or marks it as read other users will not see this. How can we resolve this? We now archive the mails when read and followed up. However
Allocate emails to user in a shared mailbox
Hi, This might be obvious, but I cannot find the answer. I have 3 shared mailboxes so any team member can see the emails. Is there a way of allocating a specific email to a user so that it is their responsibility to deal with it? Thanks in advance.
How to view shared mailbox in Outlook
How to view shared mailbox in Outlook or in another software
Customising the approval email
Is there anyway to customise the Approval email or to add further fields as the default looks so basic and unlike any of the other email notifications from Desk. My users just thought it was spam.
Pushing GCLID info from Gravity Forms to ZohoCRM
We are switching to Gravity Forms from Zoho Forms and I cannot find any good info on how to make sure my GCLID tracking info is pushed through to the CRM through my new forms. There was an article in the documentation about placing something within the
Issue Configuring SSO Integration with Cognito in Zoho Help Center
Dear Zoho Support Team, We have been working on configuring SSO integration for our Zoho Help Center using Amazon Cognito. While the setup appears to be completed successfully, we are encountering an issue when attempting to access the Help Center. The
Need manual aggregate column pathing help
See linked video here: https://workdrive.zohoexternal.com/external/a5bef0f0889c18a02f722e59399979c604ce0660a1caf50b5fdc61d92166b3e7
Merging contacts does fail because of help center membership
I'm trying to merge two contact records (they are the same contact) where one of them is a member on the help center. The system warns me about this situation and then I de-activate this contact as an "End User" for the help center. Right now the system
Duplicate Contacts - how to get merge or delete
I have noticed that our list of contacts in Zoho Desk duplicates contacts periodically. I have yet to identify when or why. How do I merge or delete them? I see there is a "Deduplicate" but I am unable to find anything that explains this feature.
"Mark as Spam" not working as expected
Dear support, in the below scenario, clicking on "Mark as spam" identifies only the first of the checked emails as spam, removes that email from the visible list and leaves the rest of the list still visible & unchecked. I've tried check-marking them
Massive price increase for user licenses of Zoho Portal
This actually a complaint about this announcement: https://help.zoho.com/portal/en/community/topic/free-user-licenses-across-all-portal-user-types You present this as an enhancement. And, yes, while reading the main part, I'd agree that (for smaller companies),
Next Page