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

                                                                                                                • How do I link my invoice to an estimate?

                                                                                                                  There has been instances where I have created estimates, however, invoices for the same estimate were created independently. The status of these estimates hasn't converted to 'invoiced'. 
                                                                                                                • I wish to upload 40000 Resumes in Zoho Recruit Database. Can I do this in batch of 1000 Resumes ?

                                                                                                                  I would like to upload thousand or few hundred of resumes in Zoho Recruit in one go. Please let me know how can I do this Or migrate my 40000 resumes from previous ATS to Zoho Recruit.
                                                                                                                • Zoho Writer for Proposals

                                                                                                                  Hi, one of the things we've struggled with since moving to Zoho ecosystem is our proposal software Qwilr does not integrate well. It surprises me Zoho doesn't have proposal software but given all the capabilities of Zoho Writer, I'm wonder if anyone is
                                                                                                                • Custom Fonts in Zoho CRM Template Builder

                                                                                                                  Hi, I am currently creating a new template for our quotes using the Zoho CRM template builder. However, I noticed that there is no option to add custom fonts to the template builder. It would greatly enhance the flexibility and branding capabilities if
                                                                                                                • Foutmelding bij uitvoering/opslaan functie 'Left expression is of type TEXT and right expression is of type NUMBER'

                                                                                                                  Hoi! Ik heb een workflow (zie bijlage) die wordt getriggerd zodra de verwachte weekomzet van een bedrijf wordt aangepast naar een bedrag hoger dan 0. Op dat moment moet een functie (zie bijlage) gaan berekenen wat het benodigde kredietlimiet moet zijn.
                                                                                                                • Hoe kun je Nederlandse loonstroken boek in Zoho Books?

                                                                                                                  Beste Community, Heeft er iemand een idee hoe je standaard loonstroken kunt inboeken in Zoho Books? Ik ben benieuwd hoe jullie dit doen en wat de mogelijkheden zijn.
                                                                                                                • Unable to Filter Retail Sales Orders & Need Paid/Unpaid Filter – Zoho Books

                                                                                                                  Hi Zoho Team, Recently you introduced Retail – Standard and Retail – Premium templates for Sales Orders. However, in the Sales Order module we still cannot filter or segregate Retail Sales Orders separately from normal B2B sales orders. Because of this,
                                                                                                                • Service op locatie organiseren met Zoho FSM: waar lopen organisaties tegenaan?

                                                                                                                  Bij organisaties met service teams op locatie merken we vaak dat de complexiteit niet zozeer in de planning zelf zit, maar in wat er rond die planning gebeurt. Denk aan opvolging na interventies, consistente servicerapporten, en het bijhouden van installaties
                                                                                                                • Possible to delete the "Big Deal Alert" in Zoho CRM?

                                                                                                                  Hi, Is it possible to delete the "Big Deal Alert" in Zoho CRM? My company has no need for it and I want to remove it to clean up my email templates list. Thank you. Moderation Update: Currently, the option to delete the "Big Deal Alert" template is in
                                                                                                                • Allow selection of select inactive users in User data fields

                                                                                                                  Hello, We sometimes need to select a previous employee that has an inactive account in the User data field. For example, when doing database cleanup and indicating actions are done by a certain employee that weren't filled out when they were part of the
                                                                                                                • [Webinar] Top 10 Most Used Zoho Analytics Features in 2025

                                                                                                                  Zoho Analytics has evolved significantly over the past year. Discover the most widely adopted features in Zoho Analytics in 2025, based on real customer usage patterns, best practices, and high-impact use cases. Learn how leading teams are turning data
                                                                                                                • Need advice for product/item search functionality when adding invoices.

                                                                                                                  My client uses "Catalog or Vendor" name and Product code to search for his items. But Zoho only allow to search by product name and SKU when adding items to Invoices/Estimates. Clients product codes are not unique as they may overlap from different catalogs/vendors.
                                                                                                                • Super Admin Logging in as another User

                                                                                                                  How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Moderation Update (8th Aug 2025): We are working
                                                                                                                • Do buttons and vba msgbox work on mobile, specifially the iPhone zoho sheets app?

                                                                                                                  In Zoho sheets on the web, I inserted a button and assigned a VBA macro to it. It pops up a msgbox with some text. When I go onto the iPhone mobile zoho sheets app, the button is there. When I click on that button, the spinning asterisk appears for a
                                                                                                                • [Webinar] Solving business challenges- Handling the challenge of transitioning to Zoho Writer from legacy tools

                                                                                                                  Moving to Zoho Writer is a great way to consolidate your business tools and become more agile. With multiple accessibility modes, no-code automation, and extensive integration with business apps and content platforms, Zoho Writer helps solve your organization's
                                                                                                                • How can I effectively manage a website with your help?

                                                                                                                  I’m wondering if it’s possible to develop a custom website with specific features using Zoho as an alternative platform. My goal is to create a website similar to https://tmsim.ph, with the same kind of functionality and user experience. I would truly
                                                                                                                • Introducing the Yes/No field: Binary decisions made beautiful

                                                                                                                  Greetings, form architects! What would you do when you need a simple yes/no answer on your form? Normally, you add a Radio field. Type Yes. Type No. Until now. The new Yes/No field is purpose-built for binary decisions. It is preconfigured, visually consistent,
                                                                                                                • Move email between inboxes?

                                                                                                                  Is it possible to move emails from one team inbox to another? We would like to be able to have a single "catch-all" inbox for incoming requests, and then move the email to the appropriate department inbox. I was hoping we would be able to accomplish this
                                                                                                                • The power of workflows in Zoho Marketing Automation - Video Webinar

                                                                                                                  In this Zoho Marketing Automation video webinar, our experts walk you through: Why you may want to create marketing workflows How to create marketing workflows Use Zoho CRM data and apply workflows to automate your marketing strategy How workflows can
                                                                                                                • Zoho CRM's sales trend and sales follow-up trend dashboards are now customizable

                                                                                                                  Dear Customers, We're here with good news! Sales trend and sales follow-up trend are two system-defined dashboards that help you understand trends and anomalies in your sales outreach and conversion efforts. They use Zia's intelligence to identify patterns
                                                                                                                • Introducing Rule-Based AI Coding Assistants for Zoho Finance Widgets

                                                                                                                  Hello customers, We’ve introduced rule-based AI coding assistants to speed up Zoho Finance widget development. You can try them out in Cursor AI and GitHub Copilot. This helps you build widgets quickly using simple prompts, while ensuring the generated
                                                                                                                • Marketing Tip #21: Create an About Us page

                                                                                                                  People don’t just buy products, they buy from brands they trust. An About Us page helps customers understand who you are, what you stand for, and why your business exists. It adds a human touch to your store and reassures shoppers that there’s a real
                                                                                                                • Zobot to handle single choice menu when dynamic list content is more than 10 items

                                                                                                                  Whatsapp supports maximum of only 10 items for its single choice menu. When we need to show a dynamic list with content more than 10, this could be challenging. We essentially need to add a next and previous buton here in order to make it functional.
                                                                                                                • Add the ability to Hide Pages in Page Rules

                                                                                                                  Hi, We have Field Rules to show and hide fields and we have page Rules, but we can't hide a page in Page Rules so it isn't completed before the previous page (And then have the Deny Rules to prevent submitting without both pages completed), we can only
                                                                                                                • Column letter from number

                                                                                                                  Hello, I am trying to select a cell and i have the column number. How do i do this or is there a way of getting the letter from the number? Thank you
                                                                                                                • Zoho One Spaces UI

                                                                                                                  Zoho One も UI が新しくなっていくようです。 Switch Space Overview https://help.zoho.com/portal/en/kb/one/spaces/spaces-ui/articles/swi#Overview Your new space for personalized business productivity https://www.zoho.com/blog/one/your-new-space-for-personalized-business-productivity.html
                                                                                                                • Zoho CRM NextGen UI

                                                                                                                  Zoho CRM の Everyone 画面の UI がまた変わるのですね。NextGen UI 更新日時が1ヶ月前で、Zoho Japan でもアナウンスされていたようですが、気が付きませんでした。 【Zoho CRM】Zoho CRM for EveryoneのUIアップデートのお知らせ https://support.zoho.co.jp/portal/ja/kb/articles/zoho-crm-zoho-crm-for-everyone-s-nextgen-ui-gets-an-upgrade
                                                                                                                • View Answer Bot conversations?

                                                                                                                  We are trialing Zia and are experimenting with Answer Bot on our knowledge base. So far so good! Management asks me if it is possible to view Answer Bot conversations, the purpose being to look over its shoulder and confirm that it is working as des
                                                                                                                • Train Zia answer bot on only part of Knowledge Base?

                                                                                                                  We are trialing Zia answer bot and hope to use it on the knowledge base to help our users find the information they are looking for. I have found how to train Zia on the entirety of our knowledge base. But is there a way to train it on only certain categories
                                                                                                                • Smarter holiday planning with yearly-specific Holiday Lists

                                                                                                                  Hello everyone! Managing holidays and business hours is now easier and more efficient. Holiday Lists now support holidays that fall on different dates every year, while business hours now supports more than one holiday list. This helps businesses manage
                                                                                                                • Temporary Outage in Zoho Cliq Affecting US Users – July 23, 2025

                                                                                                                  We experienced a service disruption in Zoho Cliq that impacted core functionality for users in the US region. The issue occurred between Jul 23, 2025, 06:54:00 PM IST and 07:13:13 PM IST, lasting approximately 19 minutes. To restore service stability,
                                                                                                                • ERROR CODE :550 - 550 5.1.1 Invalid email recipients

                                                                                                                  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. mustafa.ashraf@techlink-eg.net, ERROR CODE :550 - 550 5.1.1 Invalid email recipients
                                                                                                                • Function #20: Custom calculation in item table of invoices

                                                                                                                  When you create an invoice in Zoho Books, the 'Amount' of a line item is typically calculated as the product of the "Quantity" and the "Rate" of the item. For instance, if an item has a sales rate of $50 and a quantity of 5 is sold, then the amount would
                                                                                                                • Impossible to import Journal from Freshbooks

                                                                                                                  I have been trying to import journals from Freshbooks since August 30th. Every time I try to import, I get an error message. I have already made sure every row has a date. First it was saying the account and notes had unexpected input and that every debit/credit
                                                                                                                • Wie veröffentliche ich ein PDF Datei?

                                                                                                                  Hallo! Wie veröffentliche ich PDF Datein ich habe ein PDF Datei und den sieht ihr im Upload ich möchte ihn veröffentlichen wie? Mit Freundlichen Grüßen, Herr Bahaa Addin Chkirid
                                                                                                                • Zoho Campaigns: An Outstanding Email Marketing Tool

                                                                                                                  Introducing Zoho Campaigns! A product designed by Zoho, the Zoho Campaigns is made to create, deliver, and manage integrated email campaigns that can help in boosting the sales of a company and its customer base. Zoho Campaigns is actually an email marketing
                                                                                                                • Zoho Creator Developer Console | Improved Distribution and Lifecycle Management for apps

                                                                                                                  Hello everyone, We're excited to introduce new enhancements now in the Zoho Creator Developer Console. These updates strengthen private app distribution through licensing controls and extend environment support across all installed apps, helping teams
                                                                                                                • Zoho Books emails suddenly going to Spam since 11 Nov 2025 (Gmail + now Outlook) — anyone else?

                                                                                                                  Hi everyone, We migrated to Zoho Books in July 2025 and everything worked fine until 11 Nov 2025. Since then, Zoho Books system emails are landing in customers’ Spam (first Gmail, and now we’re seeing Outlook/Office 365 also starting to spam them). Impacted
                                                                                                                • Sync images with Shopify/Cart

                                                                                                                  Hello, sync images with shopify or other cart, it cuts out the double work of having to upload to shopify/cart and zoho. Thanks
                                                                                                                • External User onboarding for zoho connect is not really intuitive.

                                                                                                                  So the external user is sent an invite, which has a button that directs them to login to zoho to view the invite, but if they don't have a zoho account, they cannot access that invite, which seems kinda silly, as there is not real way on for them to create
                                                                                                                • Next Page