Create daily reports and send as email attachment | Zoho Creator Academy

Automatically create daily reports and send current day's reports as email attachment

Requirement

Schedule custom actions to automatically create labour reports everyday at the specified time and send a filtered report of all the reports corresponding to the current day as an email attachment.

Use case

Let's assume your company has signed with a contract agency to employ maintenance teams. The contractors allocate workers and you will have to send them a labour report everyday. This process can be automated using the Zoho Creator's schedule feature. In an Employee Tracker application, information like number of shifts worked by a worker and labour charge per shift are maintained in the Contract Labour form. The Contract Labour form's records that correspond to the current day will be automatically consolidated and added as a record in the Daily Wages form. In addition, from the Daily Wages form, only the records corresponding to the current date will be sent as email to the contractor's email address. This process takes place everyday at the specified times.

Steps to follow

1. Create two forms with the following details.

Form

Form Link Name

Field Type

Field Name

Field Link Name

Contract Employees

Contract_Employees

Name

Name

Name

Single Line

Department

Department

Number

Number of Shifts Worked

Number_of_Shifts_Worked

Currency

Wage Per Shift

Wage_Per_Shift

Currency

Total Wage

Total_Wage

Daily Wages

Daily_Wages

Single Line

Agency

Agency

Date

Date

Date_field

Subform

  • Name

  • Number

  • Currency

Workers Report

  • Name

  • Number of Shifts Worked

  • Wage

Workers_Report

  • Name

  • Number_of_Shifts_Worked

  • Wage

Currency

Total Wage

Total_Wage


2. Create a schedule with the following details:



3.Click Add New Action > Deluge Script, and save the following Deluge snippet in the Deluge editor.
  1. // HOUSE KEEPING WAGES
  2. // Define a variable to calculate total house keeping wage
  3. total_wage = 0;

  4. // Create a collection to store subform values
  5. workers_collection = Collection();

  6. //Iterate the Contract Employees form to populate the subform rows and calculate total wage.
  7. for each  worker in Contract_Employees[Department == "House Keeping" && Added_Time == zoho.currentdate]
  8. {
  9. row = Daily_Wages.Workers_Report();
  10. row.Name=worker.Name;
  11. row.Number_of_Shifts_Worked=worker.Number_of_Shifts_Worked;
  12. row.Wage=worker.Total_Wage;
  13. total_wage = total_wage + worker.Total_Wage;
  14. workers_collection.insert(row);
  15. }

  16. //Insert a new record into Daily Wages form
  17. record_id = insert into Daily_Wages
  18. [
  19. Added_User=zoho.loginuser
  20. Agency="Zylker - House Keeping"
  21. Date_field=zoho.currentdate
  22. Workers_Report=workers_collection
  23. Total_Wage=total_wage
  24. ];

  25. // SECURITY WAGES
  26. // Repeat the same steps  for calculating total wages report of Security department
  27. total_wage = 0;
  28. workers_collection = Collection();
  29. for each  worker in Contract_Employees[Department == "Security" && Added_Time == zoho.currentdate]
  30. {
  31. row = Daily_Wages.Workers_Report();
  32. row.Name=worker.Name;
  33. row.Number_of_Shifts_Worked=worker.Number_of_Shifts_Worked;
  34. row.Wage=worker.Total_Wage;
  35. total_wage = total_wage + worker.Total_Wage;
  36. workers_collection.insert(row);
  37. }

  38. record_id = insert into Daily_Wages
  39. [
  40. Added_User=zoho.loginuser
  41. Agency="Zylker - Security"
  42. Date_field=zoho.currentdate
  43. Workers_Report=workers_collection
  44. Total_Wage=total_wage
  45. ];
4. Create another schedule with the following details.



5. Click Add New Action > Deluge Script, and save the following Deluge snippet in the Deluge editor.
  1. sendmail
  2. [
  3. from: zoho.adminuserid
  4. to: "admin@zylker.com"
  5. subject: "Daily Labour Report"
  6. message: "Please find the PDF attached of Daily Labour Report"
  7. attachments:view:All_Daily_Wages [Date_field==zoho.currentdate] as PDF
  8. ]

See how it works


  1. Schedule
  2. Subform insert Deluge task
  3. Send mail Deluge task
  4. Add record Deluge task

    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









                                      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

                                                                                                        • Create Serial Number for subform rows

                                                                                                          Requirement Create serial numbers or auto-numbers for subform rows when a new row is added. Use Case In an employee management system, an employee can add up to five dependents. It will be easy for the employees if the dependents added in the subform ...
                                                                                                        • Add subform rows with dynamic data from another subform

                                                                                                          Requirement             Automatically add rows to a subform and populate it with dynamic data fetched from another subform. Use Case   A form named Orders Database contains customer details and their frequent orders in a subform. We have another ...
                                                                                                        • 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 ...
                                                                                                        • 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 ...
                                                                                                        • Store records for 30 days after deletion

                                                                                                          Requirement Deleted records must be stored for 30 days after deletion, after which they should be permanently removed from the database. Use Case A library management app is used to manage books, memberships, and other resources. When a membership is ...
                                                                                                          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