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.





    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

                                                                       
                            



                            





                              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

                                    Zoho Desk Resources

                                    • Desk Community Learning Series


                                    • Digest


                                    • Functions


                                    • Meetups


                                    • Kbase


                                    • Resources


                                    • Glossary


                                    • Desk Marketplace


                                    • MVP Corner


                                    • Word of the Day


                                      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 ...
                                                                                                • Automate a mailer to a set of users

                                                                                                  Requirement Send season's greetings automatically to all the employees in an organization on the chosen day. Use Case In a typical employee management application, the Employees form will track employee details. Sending emails is the official way of ...
                                                                                                • 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 ...
                                                                                                • Insert records through email

                                                                                                  Requirement When an email is received, content from the email is extracted and used to create records. Use Case The HR team sends an email to shortlisted candidates. Candidates can reply to the email with details that are extracted and added as ...
                                                                                                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