Custom functions can satisfy business-specific requirements by letting you write the entire function from scratch. Once created, they can be used by all members in your organization.
Use an existing custom function
Using app connections in your functions
Important note for Zoho app connections
Data Type | Description |
void | No value |
int | Integer value |
float | Decimal value |
string | Text |
bool | Either true or false |
date | Date value |
map | Key-value mapping |
list | List of values |
file | File object |
The created function will now be available under Custom Functions in the Logic tab.
If a custom function is deleted, all the flows using the function will be affected.
Zoho Flow allows you to use your app connections in custom functions by using the invokeURL task. This helps you to establish authentication with Zoho or third-party services to access data and integrate with them when using a function.
Learn more about the invokeURL task.
If you are already using any authtoken-based Zoho app connections in your invokeURL tasks, it is important that you modify them to OAuth-based connections immediately. All Zoho apps are migrating from authtoken-based authorization to OAuth-based authorization and existing authtoken-based connections will no longer work.
To update the connections:
For example, in the following function, an authtoken is used to establish a connection to Zoho Books:
After creating an OAuth connection for Zoho Books, the script can be modified to embed the newly created connection.
These are blocks of code available on the left of the custom function coding screen. Drag and drop them onto the coding area and enter the required data.
Set Variable
Creates a variable with the given value that can be accessed within the action
For example:
Every time the quantity value is changed, the value of the price will be modified
Add Comment
Adds comment to make your code understandable by others
For example:
Any data that is after '//' will be considered a comment
info
Prints the value of specified parameters as the function output in the history log
For example:
This prints the customer names in the history log
if
Checks for a condition. If the condition is true, it performs the specified action.
For example:
This checks if the client title is CEO. If it is true, the client type is set to premium.
else if
Executes when the previous if statement is false and this statement is true
For example:
When the client title is not CEO, but is Admin, the client type is set to standard
else
Executes when both if and else if statements fail
For example:
When neither if nor else if conditions hold true, the client type is set to regular.
Send mail
Sends an email to the specified recipients
For example:
webhook
Creates a webhook subscription for another application
create collection
Creates a map or a list depending on the input elements specified
insert
Adds elements to the specified collection
For example:
Adds the given names to the students list
For example:
Adds the given key-value pairs to the map
get
Fetches a particular element from the specified collection
For example:
Fetches the value at index 6 from the students list
For example:
Fetches the value mapped with the key 'name' in the students map
update
Updates the specified collection
For example:
Updates the value in the second element of the list to 'Micheal'
For example:
Updates the value in the key 'grade' to 9
for each element
Performs the task for each element in the specified collection
For example:
For every student email address available in the list, the mail will be sent
For example:
This function concatenates every value in the map. The output value of this function will be 'Emma Marley Becker'.
Sample code:
This helps transform one date format into another and converts it into a string function.
Create a custom function with the above code. Specify the following input parameters:
For example, if you are creating this custom function between a MailChimp trigger and a Zoho Creator action, map myDate to the date field from MailChimp. fromFormat will be MailChimp's date format and toFormat will be Zoho Creator's date format.
Deluge tasks and built-in functions can help you customize your functions to serve specific requirements in your workflows. The following list provides you with some possibilities to explore:
To access and modify web resources, you will need to make HTTP or API calls. In such cases, you can use the invokeURL task which is an HTTP client.
File functions allow you to operate on file objects (FILE datatype). They can help you get the file's properties, zip or unzip files, and more.
Integration tasks help you access, transfer, and synchronize data across various Zoho services. In case you want to include these integration tasks in your function, you can use this list of integration tasks.
You can work with date and time formats, perform calculations, and more using datetime and time functions.
If you need to work with advanced calculations or mathematical operations, you can use number functions in your code.
Map functions help you manipulate key-value data in a variable. For example, it lets you show the keys in a variable, remove key-value pairs, and more.
The for each record task iterates through a form's records, which can be based on specific criteria.
Conversion functions help you convert data into your required data type or structure.
For more information related to Deluge functions and tasks, you can browse through Deluge's help documentation.
Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.
If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.
Write to us: support@zohoforms.com