Customer Relationship Management Systems

Zoho Deluge - Multi-line Variable Assignments and Expressions

What?
A short article explaining how Zoho Deluge allows a variable assignment to be written across multiple lines, as long as the statement ends with a semi-colon. This has a limited number of use cases, but is useful to be aware of if you have not come across it before.

Why?
In many Deluge scripts, assignments are often more than a single value. At times, it can be useful to copy and paste or temporarily format logic across multiple lines to improve readability while writing or reviewing code.

Do bear in mind that once the script is saved and re-opened, the code will be reformatted back onto a single line.

How?
Below are three examples demonstrating multi-line assignments in Zoho Deluge.

1) Multi-line string concatenation, converted into a map
This builds a JSON string over several lines, then converts it into a map so values can be accessed by key.

v_InputData = "{"
    + "\"ID\":\"TEST-1001\","
    + "\"FirstName\":\"John\","
    + "\"LastName\":\"Doe\""
    + "}";
m_InputData = v_InputData.toMap();
info m_InputData.get("ID");
// yields "TEST-1001"

This pattern can be useful when building request payloads for API calls or preparing structured data for reuse within a script.

2) Multi-line list declaration and item access
Lists can also be declared over multiple lines, which can help when the list is longer or subject to change.

l_Items = {"a"
    , "b"
    , "c"
    , "d"
    , "e"
    , "f"};
info l_Items.get(3);
// yields "d"

This approach works well for reference lists, configuration values, or ordered datasets where readability during development is helpful.

3) Method chaining across multiple lines
Method chaining can be split across lines to make transformation logic easier to follow while writing or reviewing code.

d_MethodTests = '02-Jan-2026'
    .addDay(3)
    .addMonth(1)
    .toDate();
info d_MethodTests;
// yields "05-Feb-2026"

In all three cases, Deluge treats the semi-colon as the end of the statement, not the end of the line. This allows expressions to span multiple lines during editing while remaining valid.

When the code is saved and re-opened, it will be reformatted back into a single line, as shown below.

//
v_InputData = "{" + "\"ID\":\"TEST-1001\"," + "\"FirstName\":\"John\"," + "\"LastName\":\"Doe\"" + "}";
m_InputData = v_InputData.toMap();
info m_InputData.get("ID");
// yields "TEST-1001"
//
l_Items = {"a","b","c","d","e","f"};
info l_Items.get(3);
// yields "d"
//
d_MethodTests = '02-Jan-2026'.addDay(3).addMonth(1).toDate();
info d_MethodTests;
// yields "05-Feb-2026"
//

Zoho Analytics & Zoho People: Monitor DataSource Sync

What?
A quick article on how to setup an automation that checks if a datasource synchronization between Zoho People and Zoho Analytics failed. This can be adapted to any data source for Zoho Analytics.

Why?
We're assisting a client implement Zoho People as their new HR solution. Zoho Analytics is used to generate specific spreadsheets for a feed into their third-party payroll system. If the data is incorrect in Zoho Analytics, and payroll gets run with these discrepancies, then they will have a fair few disgruntled employees who may have been paid incorrectly. As such this system has to be reliable and the system managers need to be notified in advance of any errors with the intention to be able to correct any inconsistencies themselves.

How?
We're going to add a scheduled workflow on a daily basis at 1am in the morning every day. This will be added to the client's Zoho People instance which will check the datasource metadata via the Analytics API.

ZohoCRM to ZohoBooks: Please ensure that the shipping_address has less than 100 characters.

What?
An article to note something I didn't realize I needed: How to address the above error and how to update a Shipping Address for a specific Sales Order in Zoho Books.

Why?
You might think the following request to create a Sales Order in Zoho Books would be enough:
{
  "date": "2021-09-08",
  "zcrm_potential_id": "123456789012345678",
  "currency_code": "GBP",
  "reference_number": "Salespersons Test Reference",
  "terms": "These are our test terms and conditions",
  "customer_id": "234567890123456789",
  "payment_terms": 30,
  "salesperson_id": "345678901234567890",
  "line_items": [
    {
      "item_id": "456789012345678901",
      "discount": 0,
      "quantity": 1,
      "description": "A test product description"
    }
  ],
  "shipping_address": {
    "address": "Test Street",
    "street2": "Test Street 2",
    "city": "Test City",
    "state": "Test State",
    "zip": "Test Postal Code",
    "country": "Test Country"
  }
}
However, if you try forcing the billing or shipping address in you should get the following error:
Please ensure that the shipping_address has less than 100 characters.

How?
If you get the above error, the community forums will advise you to get the ID of the Shipping Address...
ZohoBooks: Broken UK Banking Feed

What?
This is an article on restoring an automatic banking feed within Zoho Books, specifically within the United Kingdom. The article serves as a store for both a possible resolution as well as findings from the research/investigation into the issue.

Why?
The workaround for a lot of our clients is to do a manual import (CSV) of the transactions for a particular account and then to reconcile these. This particular case covers where the Cx had a working automatic bank feed for a while but at some point simply stopped working.

How?
First let's go through a resolution and get the official response on what impact this has on refreshing the token. Then I'll put all my notes I made along the way.
ZohoCRM & Xero: Function to pull most recent quotes

What?
A follow-on article from my previous article ZohoCRM & Xero: Function to pull most recent invoices - along with their Contacts and Items (accounts/contact & products respectively).

Why?
This took me so much longer than I thought it would. It was meant to be based on the pull from invoices article I wrote earlier but with quotes from Xero, things panned out differently:
  • Date/Time values don't include a timezone
  • Issues with tax rates meant replicating a tax list copy from Xero to Zoho
  • the Client doesn't use the Items module in Xero and instead puts the product name in the description field

How?
Because my head is a little fried, I'm putting the two functions I used here and I'll document further if I remember. Note that the pre-amble is to generate a Xero access token which I documented in another article - it's behind a userwall because I usually charge for my Xero integration to Zoho CRM but user registration is free; you need to click on "Account" at the top of my website then login, then search for Xero.

ZohoCRM & Xero: Function to pull most recent invoices

What?
Thought I already had an article on this and I know my article Zoho Deluge - Connect to Xero API covered a quick query to pull some invoices but this one documents a pull and mapping into CRM invoices.

Why?
This took me a whole afternoon so I wanted a template function I could use in future when I get this request again. The additional benefit of having this template is that it includes creating contacts, accounts, and products on-the-fly as well as recording payments and checks as to which record is more up to date between ZohoCRM and Xero.

How?
The access token is generated by a function documented in my previously mentioned article Zoho Deluge - Connect to Xero API so here's the pull of the first page of invoices by most recent first (invoice date).

What?
So this is a super quick note that I'll probably remember anyway but just in case, I'm writing this article so I don't spend time researching it later.

Why?
I'm synchronizing Xero Invoices with Zoho CRM Invoices and noticed that Xero stores its dates in Unix Timestamps.

How?
We're going to filter out the unix seconds from the date provided by Xero then apply a toTime() function to it.
Zoho CRM Client Script: Map Quote to Invoice

What?
This is an article to apply an automation that when creating an invoice in CRM from a related quote, it maps in the fields.

Why?
The process should be that you go to the CRM quote record and click on "Convert" > then select "Invoice", and it should map the fields over. Great! But what if someone skips the process, in other words, goes to the quote record, and clicks on the plus icon next to "Invoices" in the left sidebar?

This script will map over the core fields, address, and line item. This took me a while to get the right syntax for writing to the invoice line items as well as setting the value of lookup fields so I thought it was worth an article and may help someone else (or even myself) in the future.

At time of print (9th October 2025), for some reason, if you click on the plus icon next to Sales Order (creates a new sales order) on the quote record, the fields auto-map. The client script below does the same for invoice as the quote lookup is a custom field on the invoice.

How?
First, we'll setup a client script specifying what triggers it (on load of the page when creating an invoice) then I'll just put the client script I used to map over all the applicable field values from the quote to the invoice within ZohoCRM.

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Accreditation

Badge - Zoho Creator Certified Developer Associate
Badge - Zoho Deluge Certified Developer
Badge - Certified Zoho CRM Developer

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF

Joes Word Cloud

Please publish modules in offcanvas position.