How to use Zoho WorkDrive files into Writer merge fields?

How to use Zoho WorkDrive images in Zoho Writer's merge fields

Overview

When performing a mail merge in Zoho Writer, image fields must be provided with a public URL to properly display the image. If your images are stored in Zoho WorkDrive, you can generate a public download URL and use it for your image fields.

This article explains multiple ways to achieve this using the WorkDrive UI, WorkDrive API, or via a Deluge script.

Method 1: Using the WorkDrive User Interface (UI)

1. Navigate to the desired image in your WorkDrive folder.


2. Click on the More option (three dots) and select New Download Link.
3. In the pop-up window, create the download link and copy it.
4. Append ?directDownload=True to the copied link.

Example:


Use the final link as the input value for your image field in Zoho Writer.

Method 2: Using WorkDrive API

You can programmatically create a download link using the following API:

Endpoint: POST <workdrive domain>/api/v1/links
Required Scope: WorkDrive.files.CREATE

Sample Payload:
{ "data": { "attributes": { "resource_id": "g576y886ac79ac5************", "link_name": "sample_link", "link_type": "download", "request_user_data": false, "allow_download": true, "expiration_date": "2021-12-12", "download_link": { "download_limit": "5" } }, "type": "links" } }
Sample Response:

Look for the 'download_url' key in the response.
Info
Append ?directDownload=True to the download_url before using it in Writer.

Method 3: Using Deluge Script

Step 1: Upload Image to WorkDrive

Use the below script and upload the image to WorkDrive.
workdrive_folder_id = "g576*****"; responseData = zoho.workdrive.uploadFile(image1,workdrive_folder_id,image1.getFileName(),true,"<connection_name>"); workdrive_resourceid = ""; if(responseData != null){ responseList = responseData.get("data"); responseData = responseList.get(0); workdrive_resourceid = responseData.get("attributes").get("resource_id"); }
Step 2: Create Download Link

Use the below script to create an external download link for the image from WorkDrive.
attribute = Map(); attribute.put("resource_id", workdrive_resourceid); attribute.put("allow_download", true); attribute.put("request_user_data", false); attribute.put("link_name", "sample_link"); attribute.put("expiration_date", "2021-12-12"); attributeMap = Map(); attributeMap.put("attributes", attribute); attributeMap.put("type", "links"); param = Map(); param.put("data", attributeMap); paramString = param.toString(); mp = Map(); mp.put("Accept", "application/vnd.api+json"); makeExternalLink = invokeurl [ url :"https://workdrive.zoho.com/api/v1/links" type :POST parameters:paramString headers:mp connection:"<connection_name>" ]; linkobj = makeExternalLink.get("data"); downloadlink = ""; if(linkobj != null) { constructURl = linkobj.get("attributes").get("download_url"); downloadlink = constructURl + "?directDownload=True"; }
Sample Download Link:

Use this final download link as the value for the image field in your Writer template.

Summary

Regardless of the method used—UI, API, or Deluge—the key requirement is:
  1. You must obtain a public download URL from Zoho WorkDrive.
  2. Append ?directDownload=True to the end of the URL.
This ensures that the link works correctly as the image field value during your Zoho Writer merge process.

      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsRetailOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceForms for Solopreneurs
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit
                              Forms for Government
                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic FormsInsurance
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsWufoo alternativeEncrypted Forms
                              Accessible FormsTypeform alternativeSecure Forms

                              WCAG

                                          Create. Review. Publish.

                                          Write, edit, collaborate on, and publish documents to different content management platforms.

                                          Get Started Now






                                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                Manage your brands on social media

                                                                  Use cases

                                                                  Make the most of Zoho Desk with the use cases.

                                                                   
                                                                    

                                                                  eBooks

                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                                   
                                                                    

                                                                  Videos

                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                                   
                                                                    

                                                                  Webinar

                                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                                   
                                                                    
                                                                  • Desk Community Learning Series


                                                                  • Meetups


                                                                  • Ask the Experts


                                                                  • Kbase


                                                                  • Resources


                                                                  • Glossary


                                                                  • Desk Marketplace


                                                                  • MVP Corner



                                                                    Zoho Sheet Resources

                                                                     

                                                                        Zoho Forms Resources


                                                                          Secure your business
                                                                          communication with Zoho Mail


                                                                          Mail on the move with
                                                                          Zoho Mail mobile application

                                                                            Stay on top of your schedule
                                                                            at all times


                                                                            Carry your calendar with you
                                                                            Anytime, anywhere




                                                                                  Zoho Sign Resources

                                                                                    Sign, Paperless!

                                                                                    Sign and send business documents on the go!

                                                                                    Get Started Now




                                                                                            Zoho TeamInbox Resources





                                                                                                      Zoho DataPrep Demo

                                                                                                      Get a personalized demo or POC

                                                                                                      REGISTER NOW


                                                                                                        Design. Discuss. Deliver.

                                                                                                        Create visually engaging stories with Zoho Show.

                                                                                                        Get Started Now









                                                                                                                            • Related Articles

                                                                                                                            • How to setup image type merge field in Zoho Writer

                                                                                                                              Overview The Image Field Merge feature in Zoho Writer lets you dynamically insert images (like profile photos, product images, logos, or scanned documents) into templates during a mail merge. You can map image fields from your data source—such as ...
                                                                                                                            • How to merge subform fields and image field via Zoho Writer's Merge APIs?

                                                                                                                              Overview Zoho Writer's Merge API enables the dynamic population of documents using data from Zoho CRM. This includes merging not only standard fields but also related list (subform) fields and image fields. This guide outlines the steps required to ...
                                                                                                                            • How to track merge status and handle errors in Zoho Writer

                                                                                                                              Overview You can track the status of the merge jobs using email notifications and the merge logs. While email notifications help you track the merge initiation and completion status, the merge logs help you track the status of jobs in progress, along ...
                                                                                                                            • Configure workflow in Zoho Books with Writer's mail merge

                                                                                                                              With the Zoho Books and Zoho Writer merge integration, you can easily generate customized documents, like shipping labels or invoices, directly from your Zoho Books data. For instance, if you need to create labels for customer orders that include ...
                                                                                                                            • How to control field rendering through merge field type settings

                                                                                                                              Overview Zoho Writer's merge fields type make the data source value appear as formatted text, numbers, dates, checkboxes, images, hyperlinks, maps, chart or watermark. This flexibility allows users to design automated proposals, invoices, and reports ...
                                                                                                                              Wherever you are is as good as
                                                                                                                              your workplace

                                                                                                                                Resources

                                                                                                                                Videos

                                                                                                                                Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                eBooks

                                                                                                                                Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                Webinars

                                                                                                                                Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                CRM Tips

                                                                                                                                Make the most of Zoho CRM with these useful tips.



                                                                                                                                  Zoho Show Resources