Overview
In job management, tracking documents and attachments can be cumbersome. Zoho Creator provides automation tools to make this process seamless. This guide walks you through a Deluge script to streamline job image handling between Zoho Creator and Zoho CRM, with optional integration into ZohoWorkDrive.
Scenario
Suppose you have two forms in Zoho Creator:
2.Comment on Job Scheduler Form: Here, users upload images and comments about the job. A subform,
Upload_Attachments, allows users to upload job-related images. These images are then synced to the Zoho CRM attachment section from Creator.
Objective
Ensure that each image uploaded through the Comment on Job Scheduler Form is:
1.Checked to avoid duplicate uploads in Zoho CRM.2.Downloaded from Zoho Creator and attached to the CRM record if not already present.
3.Optionally uploaded to Zoho WorkDrive for centralized file management.
Here's the Deluge script to automate this process:
Explanation
- Retrieve the CRM Record: Fetch the CRM record using the CRM ID from Creator.
- Check for Existing Attachments: Get related attachments from CRM and iterate to check if the image already exists by comparing filenames.
- Download & Attach: If the image does not exist, download it from Creator and attach it to the CRM record.
- Upload to WorkDrive: If a WorkDrive folder ID is available in the CRM job record, upload the image to WorkDrive for easy access.
Notes
Job_WD_Idis the WorkDrive folder ID for each job record.- Connection Names:
zcreator: Connection for accessing Zoho Creator API. workdrive: Connection for accessing Zoho WorkDrive.