Schedule a monthly email with report as pdf

Schedule a monthly email with report as pdf

Requirement

Schedule a monthly sales report to the sales manger in a PDF with stats on achieved sales versus target for the month.

Use Case

A sales management app records sales activities and numbers to track the performance of its sales team and the overall business. The sales manager needs a monthly report that graphs the achieved sales as compared to the target, in a PDF.

Steps to follow

1. Create two forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
Sales
Sales
Single Line
Sales Rep
Supplier_Name
Name
Customer Name
Customer_Name
Subform
  • Single Line
  • Number
Order
  • Product
  • Quantity
Order
  • Product
  • Quantity
 
Currency
Total Cost
Total_Cost
Target vs Achieved
Target_vs_Achieved
Date
Date
Supplier_Name
Currency
Target Sales
Target_Sales
Currency
Achieved Sales
Achieved_Sales


The Target vs Achieved form is used for the monthly reporting. The Date and Target Sales field values are provided manually every month. The Achieved Sales field's value is calculated by adding up all the values in the Total Cost field for each month.

2. Create a Pivot Chart report named Forecast vs Actual based on the form Target vs Achieved, with the settings as displayed below. Plot the Date field on the X-Axis, and Target Sales and Achieved Sales fields on the Y-Axis.


3. Configure a schedule with the following details: 

4. Click Add New Action and select Deluge Script.

5. Save the following Deluge snippet in the Deluge editor:
  1. // Fetch all records from Sales form for the current month

  2. sales_records = Sales[ID != 0 && Date_field in this month];

  3. // Calculate the total sales
  4. total_sales = sales_records.sum(Total_Cost);

  5. // Fetch records from Target_vs_Achieved form and sort in descending order to have the latest record (current month) on top
  6. forecast_records = Target_vs_Achieved[ID != 0] sort by Added_Time desc;

  7. // Assign the total sales value to the Achieved Sales field in the first record
  8. forecast_records.Achieved_Sales=total_sales;

  9. // Send mail with the attachment to the sales maneger 
  10.  sendmail
  11. [
  12. from: zoho.loginuserid
  13. subject: "Monthly Report"
  14. message: "Please find the attached monthly sales report"
  15. attachments:report:Forecast_vs_Actual as PDF
  16. ]

The script calculates the total sales for the month, and assigns the value to the Achieved Sales field. The report containing this value and the forecast value is then sent as an attachment.

See how it works      

Points to Note 

  • It is recommended to place the send mail snippet in a separate scheduler with some time gap. This ensures there is sufficient time for fresh data to be generated with new calculations in the Pivot Chart before the attachment is sent.
  • Pivot Charts can only be sent in a PDF. Learn more about the send mail task and the supported formats for various report types.





    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 FormsEnterpriseBegin 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 onboardingOrder Forms for Small Business
                          No Code FormsConstructionRSVP tool for holidays
                          Free FormsTravel
                          Prefill FormsNon-Profit

                          Intake FormsLegal
                          Mobile App
                          Form DesignerHR
                          Mobile Forms
                          Card FormsFoodOffline Forms
                          Assign FormsPhotography
                          Mobile Forms Features
                          Translate FormsReal EstateKiosk in Mobile Forms
                          Electronic Forms

                          Notification Emails for FormsAlternativesSecurity & Compliance
                          Holiday FormsGoogle Forms alternative GDPR
                          Form to PDFJotform alternativeHIPAA Forms
                          Email Forms
                          Encrypted Forms
                          Embeddable Forms
                          Secure Forms
                          Drag & drop form builder
                          WCAG



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

                                                                                                              • Understand pivot chart

                                                                                                                A pivot chart provides you with an analytical view of the data collected using a form. The data can be presented graphically for visual appeal and assimilation. Area, Line, Bar, Stacked, Pie, Scatter, Combination, Funnel, Web, and more are the chart ...
                                                                                                              • Send Page as PDF Attachment via Email

                                                                                                                Requirements Schedule an email to send a Zoho Creator page as a PDF attachment at defined time intervals using Deluge's sendMail task. Use Case To support customer engagement and business promotion, an organization uses the Pages feature in Zoho ...
                                                                                                              • Understanding report workflows

                                                                                                                Report workflows are associated with action items in Zoho Creator reports. Action item could be defined as an alternative to the existing system actions, which include edit, delete, duplicate, and view record. Zoho Creator enables you to interact ...
                                                                                                              • Understanding report creation from live mode

                                                                                                                Zoho Creator provides users with a conducive method to create reports from the live mode of the application. This enables the admin to provide specific users with the permission to create reports to the forms that they have access to. These users ...
                                                                                                              • Create pivot chart from live application

                                                                                                                You can create a pivot chart from the live mode of the application shared with you using shared analytics. To enable this feature, the admin needs to provide Create Report permission. To create a new report from live application: Click the Create ...
                                                                                                                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