How to use Zoho WorkDrive files into Writer merge fields?

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

Ask AI to explain this: ChatGPT | Perplexity | Claude

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.

Troubleshooting

1. Error / Symptom: Some images from subforms or image merge fields do not appear in the merged PDF, especially when merging documents with many images stored in Zoho WorkDrive using external share links.

Possible cause: Zoho WorkDrive external share links have a throttle limit of 40 requests per second. During PDF merge, Writer sends multiple parallel requests to download images. If the limit is exceeded, some image download requests fail, causing images to be missing in the output PDF.

Recommended solution:
  1. Avoid using WorkDrive external share links for image merge fields when merging large numbers of images.
  2. Instead, use the direct download link of the image file instead of the external share link or ensure the image source can handle multiple simultaneous download requests without throttling.
  3. Retry the merge after updating the image URLs.


        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 FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                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

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG

                                  Zoho FSM Video Tutorials


                                        All-in-one knowledge management and training platform for your employees and customers.

                                                  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


                                                                          • Desk Community Learning Series


                                                                          • Digest


                                                                          • Functions


                                                                          • Meetups


                                                                          • Kbase


                                                                          • Resources


                                                                          • Glossary


                                                                          • Desk Marketplace


                                                                          • MVP Corner


                                                                          • Word of the Day


                                                                          • Ask the Experts


                                                                            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








                                                                                                                                      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