Zoho Deluge - Multi-line Variable Assignments and Expressions
- Category: Zoho
- Hits: 46
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"
//


