Create Tasks or Scheduled Calls (from a Google Sheet) with Deluge Scripts

Create Tasks or Scheduled Calls (from a Google Sheet) with Deluge Scripts

Hi Zoho gurus,

During the migration of our old (SugarOnDemand)  to Zoho CRM,  I had several hundred calls and tasks that needed to be added to cover the gap in operations.   However, a regular import could mess with the migration process - plus there is always a need to bring in tasks and calls.  For example, set up tasks and call scheduled in support of external events.

I've created two Flows that may be useful for others.  One for adding Tasks and the other for adding Scheduled calls.  Currently, this flow monitors a Google Sheet (but you could set this up to be fired off any source) and adds a task or sheet for each new row.  You could also hook this up to form or survey, etc.

I did NOT put error checking logic into this flow, as I knew all my data was clean. 

To add such, you'd use decision blocks to check the ID of the various elements.

Flow:  Add Task to a Contact, Account and Owner



These flows make use of a few custom deluge scripts, which are what this post is really all about. Here are the scripts.

Extract Account ID from a Contact Record
Why: The Account Name field on a fetched contact record is actually a map with both the name and the id.  So you need to separate out the account's id in order to accurately fetch the full account record, and also to associate the account record to the Related To  field of both Call and Task records.

string ExtractAccountID(string accountmap)
{
mp = Map();
mp = accountmap;
return mp.get("id");
}

ExtractAccountName
This is similar to the above, but instead of return the account id, it returns the account name.

string ExtractAccountName(string accountmap)
{
mp = Map();
mp = accountmap;
return mp.get("name");
}

Formatting Dates
Gawd!  You need to be a rocket surgeon to work with dates in Zoho Deluge. I took to formatting the incoming dates in my sheet into two strictly formatted style: yyyy-MM-dd for dates and HH:mm:ss for time.
Even so, I still created a date formatter, so I would have only one place to make changes if I needed to.

string StringDateProcessor(string strdate, string strtime)
{
return strdate + "T" + strtime + "+11:00";
// following is other code I was messing about this... you get the idea.
//calctime = zoho.currenttime.addDay(1);
//return calctime.toString("yyyy-MM-dd'T'HH:mm:ss'+10:00'");
//toTime(datetimeString,"d,MM,yyyy hh:mm a","Australia/NSW");
}


Scheduling a Task
Now we get to the fun stuff!  The actual scheduling.   We have fetch the records we need (the user record to be the task owner, the contact record for the contact association on the task, and the account id which will be used  on the Related To of the task.

I've placed comments throughout this code example so you know what's going on and why.

In addition, you'll see some custom fields (I've marked them in grey) that I had added to the tasks.  You can just ignore these.  

void SheduleTask(string name, string ownerid, string callstart, string contacttid, string phone, string mobile, string purpose, string accountid, string accountname)
{
// set up the map to hold the task information to be created
mp = Map();
// the subject name comes from the trigger app (in our case google sheets)
mp.put("Subject",name);
// the ownerid comes from the fetch user step of the flow.
mp.put("Owner",ownerid);
// the due date is a correctly formatted date in yyyy-MM-dd format - in this case from the trigger app
mp.put("Due_Date",callstart);
// these two fields are taken from fetched contact record - the contact record is found by the email address
mp.put("Phone",phone);
mp.put("Mobile",mobile);
// hard coded - this is scheduling calls, after all!
mp.put("Status","Scheduled");
mp.put("Priority","Low");
// another custom field, purpose, is passed from the trigger app
mp.put("Task_Purpose",purpose);
// the contacttid is the contact id and it comes from the fetched contact record
mp.put("Who_Id",contacttid);
// you need to use the map format to link the task to the Related To field of the account.
// You also need to set the $se_module to "Accounts"
accInfo = {"name":accountname,"id":accountid};
mp.put("$se_module","Accounts");
mp.put("What_Id",accInfo);
// now you create the new task record!  FINALLY
create = zoho.crm.createRecord("Tasks",mp);
info mp; 
info create;
}

Scheduling a Call
Scheduling a call is almost identical to the Task, but it needs a data time format (tasks only use date)

void SheduleACall(string name, string ownerid, string callstart, string contacttid, string purpose, string accountid, string accountname)
{
mp = Map();
mp.put("Subject",name);
mp.put("Owner",ownerid);
mp.put("Call_Start_Time",callstart);
mp.put("Call_Type","Outbound");
mp.put("Call_Purpose","Prospecting");
mp.put("Who_Id",contacttid);
accInfo = {"name":accountname,"id":accountid};
mp.put("$se_module","Accounts");
mp.put("What_Id",accInfo);
mp.put("$which_call","ScheduleCall");
create = zoho.crm.createRecord("Calls",mp);
info mp;
info create;
}

I hope this is useful. Enjoy!

    Access your files securely from anywhere

        All-in-one knowledge management and training platform for your employees and customers.






                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts





                                                              Manage your brands on social media



                                                                    Zoho TeamInbox Resources



                                                                        Zoho CRM Plus Resources

                                                                          Zoho Books Resources


                                                                            Zoho Subscriptions Resources

                                                                              Zoho Projects Resources


                                                                                Zoho Sprints Resources


                                                                                  Qntrl Resources


                                                                                    Zoho Creator Resources



                                                                                        Zoho CRM Resources

                                                                                        • CRM Community Learning Series

                                                                                          CRM Community Learning Series


                                                                                        • Kaizen

                                                                                          Kaizen

                                                                                        • Functions

                                                                                          Functions

                                                                                        • Meetups

                                                                                          Meetups

                                                                                        • Kbase

                                                                                          Kbase

                                                                                        • Resources

                                                                                          Resources

                                                                                        • Digest

                                                                                          Digest

                                                                                        • CRM Marketplace

                                                                                          CRM Marketplace

                                                                                        • MVP Corner

                                                                                          MVP Corner









                                                                                            Design. Discuss. Deliver.

                                                                                            Create visually engaging stories with Zoho Show.

                                                                                            Get Started Now


                                                                                              Zoho Show Resources

                                                                                                Zoho Writer

                                                                                                Get Started. Write Away!

                                                                                                Writer is a powerful online word processor, designed for collaborative work.

                                                                                                  Zoho CRM コンテンツ




                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方




                                                                                                                • Recent Topics

                                                                                                                • Add "Reset MFA" Option for Zoho Creator Client Portal Users

                                                                                                                  Hello Zoho Creator Team, We hope you are doing well. We would like to request an important enhancement related to Multi-Factor Authentication (MFA) for client portal users in Zoho Creator. Currently, Creator allows us to enforce MFA for portal users,
                                                                                                                • Tables for Europe Datacenter customers?

                                                                                                                  It's been over a year now for the launch of Zoho Tables - and still not available für EU DC customers. When will it be available?
                                                                                                                • Automate Credit Card Surcharge

                                                                                                                  Is there a way to create an automation that will add a 3.0% credit card surcharge to a subscription whenever a customer pays via credit card?
                                                                                                                • Does Zoho has chatroom/chatbot url feature?

                                                                                                                  Hi Zoho community! I’m looking for a quick "Yes/No" answer for my dev team regarding Zoho’s capabilities. We currently use Zoho Desk for our Service Team and Zoho CRM for our Marketing Team to bring both functions under one platform. Our question: Does
                                                                                                                • One Support Email Managed By Multiple Departments

                                                                                                                  Hello, We use one support email (support@company.com). Incoming emails come to the "Support Department" and based on what the customer is asking, we route that ticket to different departments (billing, technical support, etc.). When users in these different
                                                                                                                • What's New in Zoho Analytics - February 2026

                                                                                                                  Hello Users! We're back with another round of updates for Zoho Analytics. This month's release focuses on giving you greater flexibility in how you visualize, manage, and act on your data - with new features like custom visualizations, remote MCP server,
                                                                                                                • Is it Possible to Modify Standard Report Urls

                                                                                                                  Is there a way to permanently modify standard report Urls? Use case: Suppose I have a Products report. Showing list as timeline, calendar, or kanban doesn't make sense. Want to hide that from users by adding #Report:Products?zc_ShowAs=false&zc_Print=false
                                                                                                                • Updated font library: New font styles and custom font options in Zoho Sheet

                                                                                                                  Zoho Sheet's font library now supports 500+ font styles in 60+ languages! The updated font library is stacked with new font styles, and some of the previously available font styles have been replaced with equivalent options. There are two ways you can
                                                                                                                • scope for phonebridge in CRM and phonebridge API documentation

                                                                                                                  Hi I cannot find the scope to be used for phonebridge in CRM API V2 calls. I am getting OAUTH_SCOPE_MISMATCH for scope group ZohoCRM.modules.ALL,ZohoCRM.setttings.ALL Also I am not able to locate the documentation for the same, All I have is phonebridge
                                                                                                                • Create custom rollup summary fields in Zoho CRM

                                                                                                                  Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
                                                                                                                • Job Alerts for Candidates

                                                                                                                  hi All, I have 2 questions relating to sharing job details with candidates. 1. is there a way to notify candidates that meet certain criteria of current jobs available? eg. I run a candidate search, and identify 50 candidates that might be suitable. Can
                                                                                                                • Zoho Wiki or new Zoho Learn

                                                                                                                  We are currently evaluating if we should move off confluence. At present in Confluence we have multiple levels within our documentation but with learn it looks like you can only have Space       - Manual             - Chapter Is it possible to have levels below Chapter? Also the same question for the existing wiki, can I have more sub-levels?
                                                                                                                • Fix image at bottom of a page fot automatic proposal creation

                                                                                                                  I'm working on a proposal document to automate our proposal creation process. So far it works fine, but I experience some problems with an image I want to have fixed at the bottom of the page AND above the footer. This section of the document consists
                                                                                                                • Can't scroll the page down unless I refresh the page

                                                                                                                  Hello, This issue has been going on with me and a lot of other users in my organization, we can't scroll down! the scrolling side bar doesn't appear and scrolling down through mouse or keyboard keys doesn't work, it seems that the page just ends in the
                                                                                                                • Price List

                                                                                                                  II want to restrict the items to display in sales, quote, etc for which custom rates are added in price list. How I can do the same in Zoho books
                                                                                                                • Let’s Talk Recruit: Still switching tabs to source?

                                                                                                                  Welcome back to the Let’s Talk Recruit series. Let’s talk about how you actually source talent. Do you open multiple job boards every single time a role opens? Run the same keyword searches you ran yesterday? Download, upload, rename, and then do it again
                                                                                                                • Kaizen #231 - Embedding Zoho Desk Tickets in Zoho CRM

                                                                                                                  Hello, CRM Wizards! This week, let us enhance cross-team visibility between Zoho CRM and Zoho Desk. We will use the Zoho Request Client inside a Related List widget to display open Zoho Desk tickets directly within the Contact record in Zoho CRM. This
                                                                                                                • EU Problem

                                                                                                                  Hi all, we've been facing issues with the Europe data center for two days. It's starting to disrupt our daily workflow. Any word on when this will be resolved?
                                                                                                                • Introducing a smarter, faster, and more flexible charting experience

                                                                                                                  Hello Zoho Sheet users, We're delighted to share the latest news about a major update to charts in Zoho Sheet! The new version supports dynamic data ranges, granular styling options, faster loading, and other interesting enhancements that allow you to
                                                                                                                • Introducing Job Alerts

                                                                                                                  Keeping candidates engaged beyond their first application is one of the most consistent hiring challenges. Many interested candidates simply do not revisit career sites regularly, which can result in missed opportunities and reduced re-applications. To
                                                                                                                • Where is the settings option in zoho writer?

                                                                                                                  hi, my zoho writer on windows has menu fonts too large. where do i find the settings to change this option? my screen resolution is correct and other apps/softwares in windows have no issues. regards
                                                                                                                • Client Script | Update - Client Script Support For Custom Buttons

                                                                                                                  Hello everyone! We are excited to announce one of the most requested features - Client Script support for Custom Buttons. This enhancement lets you run custom logic on button actions, giving you greater flexibility and control over your user interactions.
                                                                                                                • Enhance Sign CRM integration

                                                                                                                  Hello all, I'm working on a custom Deluge script to enhance the integration between Zoho CRM and Sign by using a writer merge template for additional flexibility. I want to replicate the post-sign document integration that exists between CRM and Sign
                                                                                                                • Task status - completed - other options

                                                                                                                  I have a dumb question I know i can make custom statuses for the tasks - but is there anyway to make additional "completed" statuses like for instance if i have a task "call back customer" and i leave a vm for them to call back marking it "completed -
                                                                                                                • Bank feed integration First Abu Dhabi Bank (FAB) to Zoho? (UAE)

                                                                                                                  Hello everyone, Is First Abu Dhabi Bank in the list of banks available for bank feed integration with Zoho Books? Thank you.
                                                                                                                • How to Export Filtered List of Contacts?

                                                                                                                  This seems like it should be simple, but I'm stymied. I'm trying to export a filtered list of my Contacts for analysis in a spreadsheet. The use case is that I'm an ecom business based in the US. The bulk of our customers are individuals stored as Contacts.
                                                                                                                • Possible to Turn Off Automatic Notifications for Approvals?

                                                                                                                  Hello, This is another question regarding the approval process. First a bit of background: Each of our accounts is assigned a rank based on potential sales. In Zoho, the account rank field is a drop-down with the 5 rank levels and is located on the account
                                                                                                                • 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
                                                                                                                • can we add product images in Zoho CRM Quote PDF template?

                                                                                                                  I want to create a quotation format in Zoho CRM similar to the attached PDF, where each product is displayed in a table with rpoduct image I need the product image to appear inside the line items section of the quote. However, while checking the Quote
                                                                                                                • Does Zoho Writer have Dropdowns

                                                                                                                  I want to add a drop down field in Zoho writer. Is this possible?
                                                                                                                • system not picking my default custom service report template

                                                                                                                  Can you tell me why when we create a service report always pick the (standard old) template? Even when I have a custom service report selected as Default.
                                                                                                                • Facturation électronique 2026 - obligation dès le 1er septembre 2026

                                                                                                                  Bonjour, Je me permets de réagir à divers posts publiés ici et là concernant le projet de E-Invoicing, dans le cadre de la facturation électronique prévue très prochainement. Dans le cadre du passage à la facturation électronique pour les entreprises,
                                                                                                                • Connecting Multiple WooCommerce Stores to a Single Zoho Marketing Automation Account

                                                                                                                  Is it possible to connect multiple WooCommerce stores to a single Zoho Marketing Automation account?
                                                                                                                • Service Title in Service Report Template Builder

                                                                                                                  I am currently working on the Service Report Template Builder in Zoho FSM. I have created three separate service report templates for different workflows: Preventive Maintenance Report Requested Service Report Installation Report My issue is that I cannot
                                                                                                                • Update: New Security Admin Role

                                                                                                                  Hello Zoho Directory Admins! This post is to highlight the recent role and permission changes introduced as part of the security enhancements. Previously, Helpdesk Admins had the security permissions and were responsible for managing the security configurations
                                                                                                                • Client Script | Update #14 - Client Script Support for Quick Create

                                                                                                                  Hello Everyone! We are back with another exciting and highly awaited update in Client Script! Over the past months, many of you shared your insights and requests, asking for the power to extend Client Script functionality to Quick Create forms. This capability
                                                                                                                • Empty folders are now appearing in the sidebar...

                                                                                                                  ...and the folder list is now auto-collapsed by default with no way to change. Neither of these recent updates are useful or user-friendly. ==================== Powered by Haiku https://www.haiku.co.uk ====================
                                                                                                                • Upload from Zoho Creator File Upload field to OpenAI Vector Store

                                                                                                                  I’ve struggled for quite a while to get this working properly. For a long time we relied on Azure Functions as a workaround to handle file transfers between Zoho Creator and OpenAI Vector Stores. It worked, but added unnecessary infrastructure and complexity.
                                                                                                                • Career site URL - Suggestion to modify URL of non-english job posting

                                                                                                                  Hi, I would like to suggest making a few modification to career sites that are not in english. Currently, the URL are a mix of different languages and are very long. It makes for very unprofessional looking URLs... Here is an example of one of our URL
                                                                                                                • I'd like to suggest a feature enhancement for SalesIQ that would greatly improve the user experience across different channels.

                                                                                                                  Hello Zoho Team, Current Limitation: When I enable the pre-chat form under Brands > Flow Controls to collect the visitor’s name and email, it gets applied globally across all channels, including WhatsApp, Messenger, and Instagram. This doesn't quite align
                                                                                                                • Next Page