How to add attachments alone to the contact from which the document was sent?

How to add attachments alone to the contact from which the document was sent?

Scenario: I send the documents to Zoho Sign using the 'Send with Zoho Sign' button on the Contacts view page. Once the document is sent for signing, the document details and the attachments are added to the 'Zoho Sign Documents' module. I want the attachments alone to be added to the contact from which the document was sent. Can I do this using a workflow in CRM?
This code will attach the signed document to the record from which it was triggered. For example if you have sent from record 'A' in module 'XYZ', then the signed document will be added to this record 'A'.
  1. Open ZohoCRM page, then navigate to Setup -> Customization -> Workflow rules. Create a new Workflow for the Zoho Sign Documents module.
  2. 'On a record action' -> 'Edit'
  3. Click the checkbox for Repeat this workflow whenever a Zoho Sign documents is edited.
  4. Select 'Specific field(s) gets modified'
  5. When 'Document Status' is modified to 'the value' as Signed.
  6. For the condition'Which Zoho Sign documents would you like to apply the rule to?', select the value as All Zoho Sign Documents.
                                -->Click Next.
                                -->In the list of action, select function
  7. Select the value Create your own function.
  8. Name the function and create it.
  9. Edit the arguments in the function.
  10. Add the key name as 'requestId', in the value type in # and select 'Zoho Sign Documents' module with fields as 'Zoho Sign Document Id'.
  11. Use the below code in the function and replace your Zoho Sign connection name.
  12. For Creating connection -> Go to Setup -> Developer Space -> Connections -> Create new Connection -> Select 'Zoho OAuth' -> give connection name here -> Use the same 'Connection Link Name' in the function.
  13. Select the following scopes --> Zoho Sign.account.ALL, Zoho Sign.documents.ALL, Zoho Sign.setup.READ, Zoho Sign.templates.ALL
  14. Click Create and Connect.
  15. Save the function and the workflow rules.
  1. response = invokeurl
  2. [
  3.   url :"https://sign.zoho.com/api/v1/requests/" + requestId
  4.  type :GET
  5.  connection:"Use Connection Name here"
  6. ];
  7. requestObj = response.get("requests");
  8. info requestObj;
  9. if(requestObj.containKey("request_status"))
  10. {
  11.  reqStatus = requestObj.get("request_status");
  12.  info reqStatus;
  13.  if(reqStatus.equals("completed") || reqStatus.equals("expired") || reqStatus.equals("declined") || reqStatus.equals("recalled"))
  14.  {
  15.   requestId = requestObj.get("request_id");
  16.   actions = requestObj.get("actions");
  17.   document_ids = requestObj.get("document_ids");
  18.   email = "";
  19.   order = 1000;
  20.   for each  action in actions
  21.   {
  22.    if(action.get("action_type").equals("SIGN") && action.get("signing_order") < order)
  23.    {
  24.     order = action.get("signing_order");
  25.     email = action.get("recipient_email");
  26.     records = zoho.crm.searchRecords("Custom_Module_Name","(Email:equals:" + email + ")");
  27.     if(records.size() > 0)
  28.     {
  29.      leadid = records.get(0).get("id");
  30.      for each  document in document_ids
  31.      {
  32.       document_id = document.get("document_id");
  33.       fileResponse = invokeurl
  34.       [
  35.        url :"https://sign.zoho.com/api/v1/requests/" + requestId + "/documents/" + document_id + "/pdf"
  36.        type :GET
  37.        connection:"Use Connection Name here"
  38.       ];
  39.       zoho.crm.attachFile("Custom_Module_Name",leadid,fileResponse);
  40.      }
  41.      fileResponse = invokeurl
  42.      [
  43.       url :"https://sign.zoho.com/api/v1/requests/" + requestId + "/completioncertificate"
  44.       type :GET
  45.       connection:"Use Connection Name here"
  46.      ];
  47.      zoho.crm.attachFile("Custom_Module_Name",leadid,fileResponse);
  48.     }
  49.    }
  50.    break;
  51.   }
  52.  }
  53. }



        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


                                    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








                                                                                                                                • Related Articles

                                                                                                                                • Mail Merge template

                                                                                                                                  Zoho Writer's mail merge feature lets you create documents where the content is personalized for each recipient before sending them out for signature. Unlike standard templates where only the signer details change, mail merge templates let you insert ...
                                                                                                                                • Document and Template sharing

                                                                                                                                  Sharing documents Available only in the Enterprise Edition This enhancement allows admins to share the documents of one or more users with other users across their Zoho Sign organization. This can come in handy for users working in the same team such ...
                                                                                                                                • Documents - List View

                                                                                                                                  This section displays a list of all the documents you have sent or received on your Zoho Sign account. The list view shows the name, document owner, recipients, date of creation, folder name and signature status for each document. Each document has ...
                                                                                                                                • Adding document fields automatically using text tags (field addition)

                                                                                                                                  Zoho Sign helps users to add corresponding fields automatically to the document with text tags during the document signing process. This helps users send out the document for signature more quickly than manually adding the fields every single time. ...
                                                                                                                                • Document retention

                                                                                                                                  Availability: Enterprise edition Document retention and purging allows organizations to automate document lifecycle management by setting when documents are moved to Trash and when they're permanently deleted. Benefits: Regulatory compliance: ...
                                                                                                                                  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