A peek into Deluge's file functions

A peek into Deluge's file functions

Hello everyone,

Recognizing the importance of files in Zoho products, Deluge implements FILE as a unique type of data. It also comes with a set of built-in functions that operate on FILE data type to identify the properties of files, zip or unzip files, and more. In this post, we will cover Deluge file functions that let you work with your digital documents using Deluge.

Files in Deluge
Files in Deluge must be fetched from the web or cloud service. It doesn't operate on offline files. The following are the ways you can bring files into Deluge scripting:
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.

File functions
File functions are built-in functions that operate on file objects (or FILE datatype). These functions cannot be applied on files fetched using the Zoho Creator "fetch records" task or "input" keyword.

The following table lists the file functions available in Deluge:

Function
Description
Checks if a variable is of FILE data type.
Converts a TEXT or COLLECTION value into file object. This function is supported in all Zoho services except Creator.
Returns the name of the input file.
Returns the size of the input file.
Returns the content of the input file.
Returns the type of the input file. This function is supported in all Zoho services except Creator.
Renames the input file with the specified name.
Compresses one or more file into a single zip file.
Extracts the content of the input zip file.

Apart from the above-mentioned functions, we also have setCharset, setFileType, and setParamName which can be used only on invoke URL task to set file properties.

Example 1: Uses setFileName and compress functions
Imagine you want to rename a few documents, convert them into a single zip file, and send the compressed zip file as an email attachment. The following example performs these actions in the below order:

  1. Fetches an invoice from Zoho Books. 
  2. Generates file name based on the customer name and current date & time, and renames the fetched invoice using the setFileName function.
  3. Fetches the customer's contract from Zoho Workdrive.
  4. Generates file name based on the customer name and current date & time, and renames the fetched contract using the setFileName function.
  5. Converts the fetched invoice and contract documents into a zip file using compress function.
  6. And lastly, sends the renamed file as attachment of sendMail task.

Step 1:
  1. // Fetch the required invoice from Zoho Books. invoice_pdf variable holds the fetched file object
  2. invoice_pdf = invokeUrl
  3. [
  4. url:"https://books.zoho.com/api/v3/invoices/pdf?organization_id=70XXXX516&invoice_ids=2155XXXXXXXXXXXXXXXX09"
  5. type: GET
  6. connection: "books_connection"
  7. ];

Step 2:
  1. // Generate the file name with customer name and current time. Here, customer_name is the input parameter of the custom function
  2. generated_pdf_name = customer_name + "_invoice_" + zoho.currentTime.toString("dd-MMM-yyyy_hh:mm");

  3. // Rename the file with the generated file name
  4. invoice_pdf.setFileName(generated_pdf_name);

Step 3:
  1. // contract variable holds the document fetched from Zoho Workdrive
  2. contract = invokeUrl
  3. [
  4. url: "https://workdrive.zoho.com/api/v1/download/5crsmXXXXXXXXXXXXXXXXXXXXXXXXXXXf16b8"
  5. type: GET
  6. connection: "workdrive_connection"
  7. ];

Step 4:
  1. // Generate the file name with customer name and current time. Here, customer_name is the input parameter of the custom function
  2. generated_doc_name = customer_name + "_contract_" + zoho.currentTime.toString("dd-MMM-yyyy_hh:mm");

  3. // Rename the file with the generated file name
  4. contract.setFileName(generated_doc_name);

Step 5:
  1. // Create a list to add files that need to be compressed
  2.  filesList = List();
  3.  filesList.add(invoice_pdf);
  4.  filesList.add(contract);

  5.  // Perform compress function
  6.  zip_file = filesList.compress("invoice");

Step 6:
  1. // Send email with the compressed file as attachment
  2. sendmail
  3. [
  4. from: zoho.loginuserid
  5. to: customer_email
  6. subject: "Invoice"
  7. message: "Please check attachment to find your invoice "
  8. attachments: file:  zip_file
  9. ]

Example 2: Uses extract and getFileContent functions
The following example extracts .csv files from a .zip file and uploads the content of the extracted files into a Zoho Sheet worksheet:

Step 1:
  1. // Extract .csv files from .zip file. file_collection holds the extracted files as KEY-VALUE collection
  2. file_collection = compressed_file.extract(); 

Step 2:
  1. // Iterate through the collection to access individual .csv files
  2. for each file in file_collection
  3. {
  4. // Fetch the content of the extracted .csv file
  5. content = file.getFileContent();
  6. // Use Sheet integration task to insert the fetched CSV into the specified Zoho Sheet
  7. response = zoho.sheet.insertCSV("6fbyeXXXXXXXXXXXXXXXXXXXXXXXXXXX44b56", "Sheet1", content);
  8. }

Learn more about file functions from our help documents and do let us know your questions and suggestions in the comments.


      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Function #41: Sync Associated Subforms!

            Welcome back everyone! The last custom function showed how to update a Contact with Product details from it's Related list in Deals. This week, let's look at a function that lets you update subform records in two modules simultaneously when one of them is updated. Business scenario Let's look at how subform helps in an education institution that has deployed Zoho CRM. National Public School, Austin (made up, of course!) has set up Zoho CRM and it follows the same relationship pattern of "Students",

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ








                                ご検討中の方

                                  • Recent Topics

                                  • how to differentiate if whatsapp comes from certain landing page?

                                    I create a Zobot in SalesIQ to create a Whatsapp bot to capture the lead. I have 2 landing pages, one is SEO optimized and the other want is optimized for leads comes from Google Ads. I want to know from which landing page this lead came through WhatsApp
                                  • YouTube Live #1: AI-powered agreement management with Zia and Zoho Sign

                                    Hi there! We're excited to announce Zoho Sign’s first YouTube live series, where you can catch the latest updates and interact with our Zoho Sign experts, pose questions, and discover lesser-known features. We're starting off by riding the AI wave in
                                  • Introducing Profile Summary: Faster Candidate Insights with Zia

                                    We’re excited to launch Profile Summary, a powerful new feature in Zoho Recruit that transforms how you review candidate profiles. What used to take minutes of resume scanning can now be assessed in seconds—thanks to Zia. A Quick Example Say you’re hiring
                                  • Updating Subform Record from other Form

                                    Just wanted to ask how to properly approach this. I have 2 forms and would like to trigger an auto update on the subform once record submitted. block below only updates 1 row for each recordRow in input.AV_System { AssetRecord = Site_Asset_Services[SOR_No
                                  • when I email a invoice how can i see it was sent and also were i can go to see all emails sent

                                    when I email a invoice how can i see it was sent and also were i can go to see all emails sent?
                                  • Problem with Email an invoice with multiple attachments using API

                                    I have an invoice with 3 attachments. When I send an email manually using the UI, everything works correctly. I receive an email with three attachments. The problem occurs when I try to initiate sending an email using the API. The email comes with only
                                  • Zoho Books - Hide Convert to Sales Order if it can't be used.

                                    Hi Books team, I noticed that it is not possible to convert a Quote to a Sales Order when a Quote is not yet marked as accepted. My idea is to not show the Convert to Sales Order button when it is not possible to use it, or show it in a grey inactive
                                  • How do I bulk archive my projects in ZOHO projects

                                    Hi, I want to archive 50 Projects in one go. Can you please help me out , How can I do this? Thanks kapil
                                  • Cross-Data Center Collaboration and / Or allowing users to choose DC

                                    Dear Zoho Cliq Support Team, We are writing to request a significant enhancement to Zoho Cliq that would greatly benefit our geographically dispersed development team. Current Challenge: Currently, Zoho Cliq automatically routes users to specific data
                                  • Zoho Flow - Update record in Trackvia

                                    Hello, I have a Flow that executes correctly but I only want it to execute once when a particular field on a record is updated in TrackVia. I have the trigger filters setup correctly and I want to add an "update record" action at the end of the flow to
                                  • New Mandatory One-Click Unsubscribe Link Overshadowing Custom Unsubscribe Link

                                    I was recently informed by Zoho CRM Support that they are now mandated by the large email service providers like Google and Yahoo to provide a one-click unsubscribe option in the header (not the body) of all mass emails. I have a custom unsubscribe link
                                  • Supervisor Rules - Zoho Desk

                                    Hi, I have set up a Supervisor Rule in Zoho Desk to send an email alert when a ticket has been on hold for 48 hours. Is there a way to change it so that the alert only sends once and not on an hourly basis? Thank you Laura
                                  • Send / Send & Close keyboard shortcuts

                                    Hello! My team is so close to using Zoho Desk with just the keyboard. Keyboard shortcuts really help us to be more efficient -- saving a second or two over thousands of tickets adds up quickly. It seems like the keyboard shortcuts in Desk are only for
                                  • Is it possible to register webhooks in Zoho CRM using API?

                                    Hello, I am trying to register a webhook in Zoho CRM programmatically (using the API). Specifically, I want to register a webhook that is fired when new Contacts are created in the CRM. I was able to setup a webhook using the UI, by creating a rule that
                                  • Calls where the local audio is shared, have echo

                                    When another user is sharing their screen with audio, I get echo from my own voice. We tested this with multiple users, with different audio setups, and there's no obvious way to fix it. Is this a bug you could look into, or are we missing something?
                                  • Systematic SPF alignment issues with Zoho subdomains

                                    Analysis Period: August 19 - September 1, 2025 PROBLEM SUMMARY Multiple Zoho services are causing systematic SPF authentication failures in DMARC reports from major email providers (Google, Microsoft, Zoho). While emails are successfully delivered due
                                  • No practical examples of how survey data is analyzed

                                    There are no examples of analysis with analytics of zoho survey data. Only survey meta data is analyzed, such as number of completes, not actual analysis of responses, such as the % in each gender, cross-tabulations of survey responses. One strange characteristic of Zoho analytics is that does not seem aware of how Zoho Survey codes 'multiple response' questions. These are questions where more than one option can be selected from a list. Zoho Survey stores this data as text, separated by commas within
                                  • Update application by uploading an updated DS file

                                    Is it possible? I have been working with AI on my desktop improving my application, and I have to keep copy pasting stuff... Would it be possible to import the DS file on top of an existing application to update the app accordingly?
                                  • Minimise chat when user navigates to new page

                                    When the user is in an active chat (chatbot) and is provide with an internal link, when they click the link to go to the internal page the chat opens again. This is not a good user experience. They have been sent the link to read what is on the page.
                                  • Reports: Custom Search Function Fields

                                    Hi Zoho, Hope you'll add this into your roadmap. Issue: For the past 2yrs our global team been complaining and was brought to our attention recently that it's a time consuming process looking/scrolling down. Use-case: This form is a service report with
                                  • Zoho Projects app update: Voice notes for Tasks and Bugs module

                                    Hello everyone! In the latest version(v3.9.37) of the Zoho Projects Android app update, we have introduced voice notes for the Tasks and Bugs module. The voice notes can be added as an attachment or can be transcribed into text. Recording and attaching
                                  • zurl URL shortener Not working in Zoho social

                                    zurl URL shortener Not working in while creating a post in Zoho social
                                  • In the Zoho CRM Module I have TRN Field I should contain 15 digit Number , If it Contain less than 15 digit Then show Alert message on save of the button , If it not contain any number not want to sh

                                    Hi In the Zoho CRM Module I have TRN Field I should contain 15 digit Number , If it Contain less than 15 digit Then show Alert message on save of the button , If it not contain any number not want to show alert. How We can achive in Zoho CRm Using custom
                                  • Power of Automation::Streamline log hours to work hours upon task completion.

                                    Hello Everyone, A Custom Function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as to when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:-
                                  • Zoho Bookings know-how: A hands-on workshop series

                                    Hello! We’re conducting a hands-on workshop series to help simplify appointment scheduling for your business with Zoho Bookings. We’ll be covering various functionalities and showing how you can leverage them for your business across five different sessions.
                                  • Custom report

                                    Hello Everyone I hope everything is fine. I've tried to To change the layout of the reports, especially the summary page report, and I want to divide summary of each section in the survey but I can't For example: I have a survey containing five different
                                  • Zoho Journey - ZOHO MARKETING AUTOMATION

                                    I’ve encountered an issue while working with a journey in Zoho Marketing Automation. After creating the journey, I wanted to edit the "Match Criteria" settings. Unfortunately: The criteria section appears to be locked and not editable. I’m also unable
                                  • Custom Fields in PDF outputs

                                    I created a couple of custom fields. e.g Country of Origin and HS Tariff Code. I need these to appear on a clone of a sales order PDF template but on on the standard PDF template. When I select "appear on PDFs' it appears on both but when I don't select
                                  • How to create a Service Agreement with Quarterly Estimate

                                    Hello, I'm not sure if this has been asked before so please don't get mad at me for asking. We're an NDIS provider in Australia so we need to draft a Service Agreement for our client. With the recent changes in the NDIS we're now required to also include
                                  • Change Currency symbol

                                    I would like to change the way our currency displays when printed on quotes, invoices and purchase orders. Currently, we have Australian Dollars AUD as our Home Currency. The only two symbol choices available for this currency are "AU $" or "AUD". I would
                                  • Python - code studio

                                    Hi, I see the code studio is "coming soon". We have some files that will require some more complex transformation, is this feature far off? It appears to have been released in Zoho Analytics already
                                  • Zoho Social - Post Footer Templates

                                    As a content creator I often want to include some information at the end of most posts. It would be great if there was an option to add pre-written footers, similar to the Hashtag Groups at the end of posts. For example, if there is an offer I'm running
                                  • Seriously - Create multiple contacts for leads, (With Company as lead) Zoho CRM

                                    In Zoho CRM, considering a comapny as a lead, you need us to allow addition of more than one contact. Currently the Lead Section is missing "Add contact" feature which is available in "Accounts". When you know that a particular lead can have multiple
                                  • The Social Wall: August 2025

                                    Hello everyone, As summer ends, Zoho Social is gearing up for some exciting, bigger updates lined up for the months ahead. While those are in the works, we rolled out a few handy feature updates in August to keep your social media management running smoothly.
                                  • Ugh! - Text Box (Single Line) Not Enough - Text Box (Multi-line) Unavailable in PDF!

                                    I provide services, I do not sell items. In each estimate I send I provide a customized job description. A two or three sentence summary of the job to be performed. I need to be able to include this job description on each estimate I send as it's a critical
                                  • Allow to pick color for project groups in Zoho Projects

                                    Hi Zoho Team, It would be really helpful if users could assign colors to project groups. This would make it easier to visually distinguish groups, improve navigation, and give a clearer overview when managing multiple projects. Thanks for considering
                                  • Zoho Books - Quotes to Sales Order Automation

                                    Hi Books team, In the Quote settings there is an option to convert a Quote to an Invoice upon acceptance, but there is not feature to convert a Quote to a Sales Order (see screenshot below) For users selling products through Zoho Inventory, the workflow
                                  • Can't find imported leads

                                    Hi There I have imported leads into the CRM via a .xls document, and the import is showing up as having been successful, however - when I try and locate the leads in the CRM system, I cannot find them.  1. There are no filters applied  2. They are not
                                  • Custom Button Disappearing in mobile view | Zoho CRM Canvas

                                    I'm working in Zoho CRM Canvas to create a custom view for our sales team. One of the features I'm adding is a custom button that opens the leads address in another tab. I've had no issue with this in the desktop view, but in the mobile view the button
                                  • The connected workflow is a great idea just needs Projects Integrations

                                    I just discovered the connected workflows in CRM and its a Great Idea i wish it was integrated with Zoho Projects I will explain our use case I am already trying to do something like connected workflow with zoho flow Our requirement was to Create a Task
                                  • Next Page