Overview
Custom Functions in Zoho Writer allow you to add automation, logic, and integrations to document workflows. Using Deluge scripts, you can program actions to occur immediately after a document is merged, filled, signed, PDF combined or when a workflow is completed.
Where can custom functions be used in automation?
You can execute a custom function in Zoho Writer at various stages of a document workflow:
After the merge is complete
After the merged document is stored
After a user submits a fillable document
Once the document signing process is complete
These trigger points allow you to automate follow-up actions such as storing files, updating records, notifying stakeholders, or integrating with other apps and services.
Prerequisites (while using API)
Step 1: Open Deluge Editor
- For Merge Templates: Choose the required Merge Output Option > Select Configure Execute Function to open the Deluge editor.
- For Fillable Templates: Under "On Submission", choose Trigger Webhook and Custom Function.
- For Sign Templates: Select Send for Sign > Enable Execute Custom Function > Configure.
Step 2: Choose or Create a Function
- Or, use a prebuilt function from the gallery
Step 3: Create a Connection
Connections are used to authenticate requests sent to external services and can be integrated into Custom Functions in Zoho Writer. They enable you to retrieve data from other services directly into your document workflows.
To use a connection in a custom function:
You must create the connection that links Zoho Writer with the external service.
Then, write a custom function that uses this connection to fetch or send data as needed.
To know how to create a connection, refer to this help link.
Step 4: Save & Link the Function
Limitations of Deluge Custom Functions
Limitation | Description |
| Max 5 minutes per function execution.
Max 40 seconds per invoke url task.
|
File handling size | Max upto 20MB |
| Recursion is not supported.
|
| Scripts run sequentially; parallel execution isn't allowed.
|
Frequently Asked Queries
1. Can I execute Custom Functions on templates/documents shared with me?
Yes. The function executes using the creator's authorization and access rights.
2. How to create a dynamic table and pull subform records using Deluge?
Refer to this article for details on handling subform data.
3. Can I trigger a Deluge function after an approval workflow is completed?
Yes. In your merge template, choose Merge > Send for Approval, enable Execute Custom Function, and configure it to move the document to Zoho Contracts.
4. How can I attach a merged document to a CRM record?
Use Merge & Store > After Merge > Execute Custom Function and configure using the Attach to CRM Record gallery function.
Troubleshooting
|
|
|
| Syntax error in Deluge script
| Use colon instead of comma when mapping merge_data.
Example: merge_values.put("merge_data", {"data": mp}); Refer to this article for error details.
|
Images from Inventory not showing
| Inventory image URL not accessible
| Upload image to WorkDrive via Deluge, get public URL, and use that in merge field.
Refer to this article for more details. |
Error R3000 when merging and saving to WorkDrive
|
| Include WorkDrive.files.ALL for WorkDrive folders in OAuth scopes
|