Email Customer the Job Sheets when a Service Appointment is Completed

Email Customer the Job Sheets when a Service Appointment is Completed

Use case: When a service appointment is completed, email the customer the completed job sheets in the service appointment.
 
Follow the steps below to implement this use case:

Step 1: Create a connection   

To use the Zoho FSM APIs via the invokeURL task in the custom function, you need to create a connection for Zoho FSM. To do so:
  1. Navigate to Setup > Developer Space > Connections and under Custom Services, and click Create Service.



  2. Enter the following details and click Create Service.
    1. Service Name: ZFSM
      The Service Link Name will be automatically populated.
    2. Authentication Type: OAuth2
    3. Parameter Type: Header
    4. Grant Type: Authorization Code
    5. Generated Consumer Key, Consumer Secret
    6. Authorize URL: https://accounts.zoho.com/oauth/v2/auth?access_type=offline&prompt=consent
    7. Access Token URL: https://accounts.zoho.com/oauth/v2/token
    8. Refresh Token URL: https://accounts.zoho.com/oauth/v2/token
    9. Scope: ZohoFSM.modules.JobSheets.READ
      Provide a Scope Display Name.



  3. Click Create Connection.



  4. Perform the following and click Create And Connect:
    1. Connection Name: ZFSM
      The Connection Link Name will be populated automatically.
    2. Disable Use Credentials Of Login User. If this is disabled, the connection will utilize the credentials of the connection owner.
    3. Select the Scopes ZohoFSM.modules.JobSheets.READ
  5. Click Connect.
  6. Click Accept.
In the custom function, where the Zoho FSM API is used via the invokeURL task, use this Connection Link Name.

Step 2: Create a custom function 

Create a custom function in Zoho FSM to email the customer the completed job sheets of a service appointment.
  1. Navigate to Setup > Automation > Functions and click Create Function.
  2. Enter the following details and click Save:
    1. Function Name: SendJobsheetsToCust
    2. Module: Service Appointments
    3. In the Deluge Script Editor, enter the following script:

try

{

file_list = list();

Appointment_id = service_appointment.get("id");

contactId = service_appointment.get("Contact").get("id");

contactResp = zoho.fsm.getRecordById("Contacts",contactId);

email = contactResp.get("data").toMap().get("Email");

info email;

related_resp = invokeurl

[

url :"https://fsm.zoho.com/fsm/v1/Service_Appointments/" + Appointment_id + "/Job_Sheets"

type :GET

connection:"zfsm"

];

if(!related_resp.isNull() && !related_resp.isEmpty())

{

jobsheetResp = related_resp.get("data");

if(jobsheetResp.isNull() || jobsheetResp.isEmpty())

{

info "No jobsheets present in the SA !!!";

}

else

{

jobsheet_list = related_resp.get("data").toList();

for each  jobsheet in jobsheet_list

{

Status = jobsheet.get("Status");

if(Status.equalsIgnoreCase("Completed"))

{

filename = jobsheet.get("Name");

file_id = jobsheet.get("id");

if(!file_id.isNull() && !file_id.isEmpty())

{

fileResp = invokeurl

[

url :"https://fsm.zoho.com/fsm/v1/Job_Sheets/" + file_id + "/actions/download?type=pdf"

type :GET

connection:"zfsm"

];

filename = filename + ".pdf";

fileResp.setFileType("pdf");

fileResp.setFileName(filename);

file_list.add(fileResp);

}

}

}

}

}

if(!file_list.isEmpty())

{

sendmail

[

from :zoho.adminuserid

to :email

subject :"Jobsheets "

message :"PFA"

Attachments :file:file_list

]

}

}

catch (err)

{

info err;

sendmail

[

from :zoho.adminuserid

to :zoho.adminuserid

subject :"Error in executing the code"

message :err

]

}

Step 3: Create a workflow rule

Create a workflow rule in Zoho FSM to automatically email to the customer the completed job sheets of a service appointment when the service appointment is Completed.
  1. Go to Setup > Automation > Workflow Rules and click Create Workflow.
  2. Enter the following details, then click Next:
    1. Module: Service Appointments
    2. Rule Name: SendJobsheetsToCust
    3. Description: On service appointment completion, email the job sheets in service appointment to the customer.



  3. Select the rule trigger as Edited. Select Specific field(s) gets modified and add the condition When Status is modified to the value Completed. Check Repeat this workflow whenever a Service Appointment is edited. Click Next.



  4. Select the rule criteria as To all Service Appointments. Click Next.



  5. Click +Action and select Functions.



  6. Select Existing Functions and click Next.



  7. Select the custom function created in the previous step.



  8. Click Save.


Testing the usecase  

  1. Create a Service Appointment.
  2. Complete a job sheet in the service appointment.
  3. Click Complete Work for the service appointment.
    The job sheets will be emailed to the contact in the service appointment.

      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 FormsLegalMobile App
                              Form DesignerHRMobile 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 FormsEncrypted Forms

                              Secure Forms

                              WCAG

                                      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

                                                                                                                        • Job Sheets

                                                                                                                          Job Sheets are customizable, reusable forms that serve as a checklist for the services that technicians need to carry out and as a tool for data collection. While on location, the checklists and instructions within the job sheet guarantee that the ...
                                                                                                                        • Email Customers the Attachments in Service Appointment Notes

                                                                                                                          Usecase: On service appointment completion, email the attachments in service appointment notes to the customer. Follow the steps below to implement this usecase: Step 1: Create a connection for Zoho FSM Step 2: Create a custom function Step 3: Create ...
                                                                                                                        • Email Customer the Service Reports along with the Invoices

                                                                                                                          Usecase: When a service appointment is completed, email to the customer the service reports in the service appointment and the invoices in the parent work order. Follow the steps below to implement this usecase: Step 1: Create connections Step 2: ...
                                                                                                                        • Service Tasks

                                                                                                                          Service tasks are subtasks or child tasks that you can add to a service. When you want to handle a service that is a composite task consisting of several activities, then creating service tasks for the service will come in handy. For example, ...
                                                                                                                        • Service Appointments

                                                                                                                          Service appointments are jobs created for carrying out the services in a work order. These service appointments are assigned to field agents or crew who will then perform the services at the contact location. As many service appointments as the ...
                                                                                                                          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