Understand custom action in form workflows
Zoho Creator provides a collection of predefined actions that can be configured directly from the Workflows section. Although the list of actions that exist in the workflows section is extensive, it is nevertheless finite. In some cases, you may have to implement a specific business logic whose requirements are not met by the predefined workflow actions that are available.
To cater these specific requirements, Zoho Creator lets you create and add custom actions in your workflow. You can create these custom actions using our simple yet powerful scripting language, Deluge. Deluge bridges the gap between your thought process and your application's logic, which helps you perform complex actions with fewer lines of code than with traditional programming languages. The custom action section consists of the drag and drop Deluge script builder that lets you add functions and logic to your application to complete complex business tasks.
You can create and execute the custom action in any of the below events.
- On load
The script actions that you define in the on load event will be executed when the form is loaded by the user to add a new record or to edit an existing record.
- On validate
The script actions that you define in the on validate event will be executed when a user submits the form to the server, before the user data is stored in the database.
- On success
The script actions that you define in the on success event will be executed when a new record is successfully submitted to the database or when an existing record is updated or deleted from the database.
- On user input
The script actions that you define in the on user input event will be executed whenever the field value is added or modified by the user. It is used to improve the usability of a form by validating field data even before it is submitted or display other field values based on the value specified in this field.
The custom action can be used exactly like the list of other predefined actions. This capability lets you customize the functionality in your workflow to match any of your specialized business requirements.