How to merge documents with data from Zoho Creator?

How to merge documents with Main & Subform data from a Creator App?

To create templates to be merged with Creator App containing a main form and sub forms, first capture form fields and Subform field relationships as a JSON object as shown below. Download the sample JSON data.




Step 1 : Prepare Template 
  • Log in to Writer and create a new document or open an existing template.

  • Click More > Automate > Prepare > Merge template.




Under the With Data Source header, select the Import CSV or JSON option. You can import the JSON file from your computer or from web URL and merge it with your document.



Step 2 :  Insert merge fields & pre-configure output settings 

  • Add special merge fields in your template and configure the type and value for each field.

  1. Pre-configure the output settings required for your workflow & save


Step 3 : Run Merge on Form Submit

Define deluge based workflow functions to be invoked on creator form submit.

    fields = invokeurl

    [

     url: "https://zohoapis.com/writer/api/v1/documents/<documentid>/fields"

     type: GET

     connection:OAuthconnection

    ];

    info fields;

 

//To merge & store document in WorkDrive

output_settings = Map();

output_settings.put("doc_name","merged_output_doc");

mappedField = map();

mappedField.put("Email", "mail");

mappedField.put("FName", "FirstName");

mappedField.put("LName", "Last Name");

zoho.writer.mergeAndStore(<document_rid>,mappedFields,output_settings,

"writer_oauth_connection");

 

//To merge & send document via email

mappedField1 = map();

mappedField1.put("Name", "Shawn");

mappedField1.put("Age", "20");

mappedField2 = map();

mappedField2.put("Name", "Kate");

mappedField2.put("Age", "29");

dataList = list();

dataList.add(mappedField1);

dataList.add(mappedField2);

data=Map();

data.put("data",dataList);

merge_values = Map();

merge_values.put("subject", "Merge and send Deluge task");

merge_values.put("merge_data", json_text);

emailId = "shawn@zylker.com";

//Possible formats inline| pdf| docx.

//Message param is mandatory for inline format.

format = "inline";   //optional

merge_values.put("message", "Document merged successfully");

// Perform the Merge and Send task

response = zoho.writer.mergeAndSend("<document_rid>", "inline", emailId, merge_values, "writer_oauth_connection");

Refer: Deluge Writer Tasks 

To merge subform fields, refer here https://help.zoho.com/portal/en/kb/writer/for-developers/articles/how-to-merge-subform-fields-via-merge-api-in-writer 







    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





                        Still can't find what you're looking for?

                        Write to us:  support@zohoforms.com


                              




                            


                          New to Zoho Social?

                              Zoho Marketing Automation

                                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 SalesIQ Resources



                                                        Zoho TeamInbox Resources



                                                                Zoho DataPrep 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 merge documents with main form data of Zoho Creator App?

                                                                                              To merge Writer Documents with  Zoho Creator application's main form data , follow the below steps. Create or open the required document. Click More Options(☰)  > Automate > Merge Template Select Zoho Creator as your data source and wait while Writer ...
                                                                                            • How to add Zoho Creator subform fields to Writer template?

                                                                                              Due to limitations in the Creator API, subforms in Creator will not be listed in Writer. However, as a workaround you can do the following: 1. Prepare JSON with your form and subform fields as shown in this article step by step. 2. Import this JSON ...
                                                                                            • How to merge Writer templates using Zoho Flow?

                                                                                              We're working on a Zoho Flow-Writer integration to help you pick template documents from Writer, place merge fields on them and merge it with data from Zoho Services. Find below steps to merge Writer Documents and with Zoho Creator Form fields. ...
                                                                                            • Connecting a Data Source

                                                                                              Data Sources Writer fetches data from the source document and places it in the merge template to generate separate output documents for each record. The source document can be anyone of the following: CSV or JSON file Use a CSV file- comma separated ...
                                                                                            • How to set up mail merge for sending Offer Letters using Zoho Writer?

                                                                                              Offer Letters can be created and sent out in bulk automatically in minutes. Follow these steps to create a template and send the offer letters in a few clicks using Zoho Writer's mail merge. Here are the steps: Create a blank document in Zoho Writer. ...
                                                                                            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