This article describes how to transfer files from Zoho Creator file upload fields to Zoho CRM file upload fields. I'm posting it here because the current documentation does not fully and accurately describe how to do this with certain file types (PDF, in my case), and I was only able to get it working after a lot of troubleshooting and back-and-forth with Creator support.
If you try to transfer a PDF from a Creator record to a CRM file upload field, you may encounter one the following:
Here's how to make it work.
Transfer a file uploaded via a Zoho Creator form field into a file upload field on a Zoho CRM record, preserving the file intact.
The obvious approach is to download the file from Creator using invokeUrl, convert it to a file object using toFile(), upload it to the CRM file store, and then update the CRM record with the resulting file ID. This approach is described in Zoho's documentation and appears to work, as every step returns a success response, but produces a blank or corrupted file in CRM for any binary file type, including PDFs.
The root cause is that toFile() does not faithfully round-trip binary data through Deluge's runtime. For plain text files like CSVs, this isn't a problem. For binary files like PDFs, toFile() corrupts the content during conversion. The size inflation (original file smaller than the CRM version) is the diagnostic signature of this corruption.
The documentation offers several apparent alternatives:
getFileContent() returns TEXT and explicitly warns in a footnote that "file types that usually contain images (for example .pdf, etc.) will return junk values."
setFileType() is documented as applicable to all Zoho services except Zoho Creator, making it useless in this context.
The solution differs depending on whether you are transferring a text-based file (CSV, TXT) or a binary file (PDF).
toFile() to convert the invokeUrl response, POST to the v5 CRM files endpoint, and update the record using zoho.crm.updateRecord.For binary files, skip toFile() entirely. Call setParamName() directly on the invokeUrl response object, POST to the v8 CRM files endpoint, and update the record using a raw invokeUrl PUT with the File_Id__s map structure. The zoho.crm.updateRecord method does not work for v8 file field updates.
Since the two file types require different pipelines, it is worth validating the file extension before the on-submit script runs. In Zoho Creator, alert and cancel submit are only valid in validate scripts, not on-submit scripts. Add a validate script to your form with the following pattern:
The .toLowerCase() call on the extension is important -- without it, a file named Report.PDF would pass validation on some systems and fail on others.
This pipeline requires three connections:
invokeUrl GET to download the file from Creator. This is the built-in Zoho Creator connector in Microservices > ConnectionsinvokeUrl POST to upload the file to the CRM file store; requires scopes ZohoCRM.bulk.ALL and ZohoCRM.bulk.READ. This is the OAuth2 connection type.invokeUrl PUT to update the CRM record (v8 PDF pipeline) or zoho.crm.updateRecord (v5 CSV pipeline). This uses the built-in Zoho CRM connection type.| File Type | Download Method | Upload Endpoint | Update Method |
CSV / TXT | invokeUrl + toFile() | v5 /crm/v5/files | zoho.crm.updateRecord |
PDF | invokeUrl + setParamName() | v8 /crm/v8/files | invokeUrl PUT with File_Id__s |
I was not able to find documentation that explains the distinction between v5 and v8 and the requirement to skip toFile() for binary files in Zoho's official documentation at the time of writing. This pipeline was identified through direct testing and a support escalation with Zoho Creator support.
Hope this saves someone a few hours. If Zoho has updated their documentation to cover this since this was posted, please add a comment.