File data type
Table of Contents
Overview
Recognizing the importance of files in Zoho products, Deluge implements FILE as a unique type of data. Files in Deluge must be fetched from the web or cloud service. It doesn't operate on offline files. There are several built-in functions called File functions that operate on FILE datatype. The following are the ways you can bring files into Deluge scripting:
- Use invoke URL or get URL to fetch files from web.
- Use invoke URL to fetch files stored in any Zoho or third-party services.
- Use integration tasks that return a file as response. Example: zoho.writer.mergeAndDownload
- Use Zoho Creator fetch record task or input.<expression> to fetch values uploaded in file type fields like "file upload", "image", "video", "audio", and "signature" fields. This is applicable only for Zoho Creator.
Irrespective of the format, all the files fetched using any of the above-mentioned methods, except the "fetch records" task and "input" keyword, are treated as file objects (or FILE data type).
For example, be it a .pdf format file or a .jpeg format file, both are categorized under FILE data type. The files fetched using the "fetch records" task and "input" keyword are not considered as FILE data type, and hence file functions cannot be applied on them. However, such files can be used in integration tasks (for example in attach file crm task), or in the send mail task to send as a file attachment, or to assign the file as a value to another Zoho Creator file field.
Example 1: Fetch files using invokeUrl task
// to fetch file from the cloud using invokeUrl task file_variable = invokeUrl [ url: "https://sample-videos.com/img/Sample-png-image-100kb.png" type: GET ];
Where:
file_variable
"https://sample-videos.com/img/Sample-png-image-100kb.png"
Example 2: Integration with Zoho Sign
The following script downloads the specified document from Zoho Sign using its request ID:
file_variable = zoho.sign.downloadDocument(2131000000002069);
Where:
file_variable
2131000000002069
- See this page to find the built-in functions applicable to Number data type.