Recent updates to built-in functions in Deluge

Recent updates to built-in functions in Deluge

Hello everyone, 
Deluge offers more than 200 built-in functions for widely performed actions, like adding specified number of business days to a date, removing extra leading & trailing spaces in a text, and so on. You can refer to our help documents and flashcards to learn more. 

We have now expanded the built-in functions set available in Deluge by supporting 11 new functions. These new functions are available in all Zoho services that support Deluge. Let us take a look at them:

Text functions

  Built-in function

Description
Example
Gets prefix of the specified search text in the input text. This function performs case-insensitive search.
inputText = "Zoho Deluge";
searchText = "DELUGE";

info inputText.getPrefixIgnoreCase (searchText); // Returns "Zoho "

Gets suffix of the specified search text in the input text. This function performs case-insensitive search.
inputText = "Zoho Deluge";
searchText = "ZOHO";

info inputText.getSuffixIgnoreCase (searchText); // Returns " Deluge"

Replaces all occurrences of the specified search text in the input text with the specified new text. This function performs case-insensitive search.
inputText = "Zoho Creator Zoho Creator";
searchText = "CREATOR";
newText = "Deluge";

info inputText.replaceAllIgnoreCase (searchText, newText); // Returns "Zoho Deluge Zoho Deluge"

Replaces the first occurrence of the specified search text in the input text with the specified new text. This function performs case-insensitive search.
inputText = "Zoho Creator Zoho Creator";
searchText = "CREATOR";
newText = "Deluge";

info inputText.replaceFirstIgnoreCase (searchText, newText); // Returns "Zoho Deluge Zoho Creator"

Returns a text with the characters of the input text in reverse order.
inputText = "Deluge";

info inputText.reverse(); // Returns "eguleD"

repeat
Returns a text with the input text repeated for the specified number of times.
inputText = "Deluge";
repeatCount = 3

info inputText.repeat (repeatCount); // Returns "DelugeDelugeDeluge"

Checks if all characters of the input text are valid ASCII characters.
inputText = "ZohoßDeluge123";

info inputText.isAscii(); // Returns false


Number functions


Built-in function
Description
Example
Returns the fraction part of the input number.
inputNumber = "24.6";

info inputNumber.frac(); // Returns 0.6


Date functions


Built-in function
Description
Example
Returns the next immediate date from the input date that falls on the specified day.
inputDate = '22-Jul-2021'; // is a Thursday
inputDay = "Sunday";

info inputDate.nextWeekDay (inputDay); //Returns 25-Jul-2021

Returns the immediate previous date of the input date that falls on the specified day.
inputDate = '22-Jul-2021';
inputDay = "Tuesday";

info inputDate.previousWeekDay(inputDay); //Returns 20-Jul-2021

Subtracts the specified number of business day from the input date.
inputDate = '21-Jul-2021';
businessDays = 5;
weekends = {"Sunday"};
holidays = {'20-Jul-2021','19-Jul-2021'};

info inputDate.subBusinessDay (businessDays, weekends, holidays); // Returns 13-Jul-2021 


You can keep track of all the new releases, bug fixes, and improvements from our release notes. Do let us know your questions and suggestions in the comments.








      • Sticky Posts

      • Function #41: Sync Associated Subforms!

        Welcome back everyone! The last custom function showed how to update a Contact with Product details from it's Related list in Deals. This week, let's look at a function that lets you update subform records in two modules simultaneously when one of them is updated. Business scenario Let's look at how subform helps in an education institution that has deployed Zoho CRM. National Public School, Austin (made up, of course!) has set up Zoho CRM and it follows the same relationship pattern of "Students",