Triggers | Online help | Zoho Sigma

Triggers & Events

Triggers are configured to invoke function blocks when specific events occur in the application or Zoho service. For example, you can trigger a welcome email to a user when your extension is installed. The mail notification function is configured in the trigger called extension-install so that the user receives your welcome mail when they install your extension. These events are broadly categorized into: extension life cycle events, service specific events, and user created custom events. You can view the list of default events from Trigger Events.

Extension life cycle events

These events are directly associated with the extension. You can create a trigger for an extension installed event or based on any other extension event.

extension_on_run 

This event is triggered when you click Run  to test your extension. 

extension_on_stop

This event is triggered when you disable development mode to run your extension.

extension_installed

This event is triggered when you install an extension. 
For instance, You can trigger a function to execute a webhook that connects the third party app (Zendesk). Write a function to configure a webhook and use this event to execute that trigger automatically whenever a user installs your extension.

extension_uninstalled

This event is triggered whenever your extension is uninstalled. Use this trigger to remove the configuration or pre-setup activities done during set up in target applications.

extension_disabled

This event is triggered whenever your extension is disabled.

extension_enabled

This event is triggered whenever your extension is enabled.

extension_updated

This event is triggered whenever your extension is updated. For example, consider you want to install a set of security packs whenever your extension is enabled. Build a function for security updates and name it as DoSecurityUpdate. Create a trigger for extension_updated event and associate the function with this trigger event.

extension_upgraded

This event is triggered when a user upgrades to a paid version of your extension.

Service events

These events are specific to the service that you make use of. For example, if you are creating extensions for Zoho Projects then following are some service specific events: create_bug, delete_bug, update_task etc. You can write functions for specific events as per your business needs and trigger the events when required. Service specific events are fixed and it varies based on the service which you make use of to create extensions.

Custom Events 

Sigma allows you to create your own customized events along with the existing service events. The newly added custom events can then be associated with triggers in Sigma.

Add trigger to your function 

  1. Navigate to the  Extension module and hover over your extension and click
  2. Navigate to Triggers and click  Add Trigger
  3. Enter a name for your trigger and select the event to trigger.  
  4. Associate a function to your trigger. 
  5. Choose the corresponding version.  
  6. Click Create

 

Edit trigger associated with an extension

  1. Navigate to Extensions , hover over your extension and click .
  2. Go to the Triggers tab.
  3. Click (...) beside the corresponding trigger.
  4. Click Edit.
  5. Make necessary changes to the trigger.
  6. Click Update.

Delete trigger associated with an extension

  1. Navigate to Extensions, hover over your extension and click .
  2. Go to the Triggers tab.
  3. Click the (...) beside the corresponding trigger.
  4. Click Delete.

Trigger will be permanently deleted and can't be retrieved.

Add Custom Events 

Say you don’t want to use the predefined events, then use custom events to trigger your function. 
  1. Navigate to the  Extension module and hover over your extension and click
  2. Navigate to Triggers and click Add Trigger
  3. Enter a name for your trigger. 
  4. Click Add Custom Event.  You can also choose an existing one.
  5. Enter a name for your custom event and click the tick icon on the right.
  6. Associate a function to your trigger. You can associate up to 5 different functions.
  7. Select the corresponding version to be associated. 
  8. Click Create.         


Executing Custom Triggers using API

Custom Triggers are triggers associated with custom events in Sigma. Sigma allows you to execute triggers associated with custom events via API. This can further be used in the webhooks of third-party services.
 
The custom event must be called by the developer using the below Custom Trigger execution API:
  1. POST    https://<APP UUID>.sigmaexecution.com/workspace/invokecustomtrigger
 
To execute a Sigma function, use *.sigmaexecution domain.
Note: This functionality is currently supported only for Orchestly and Zoho Projects' extensions.

Business Case

Zoho Projects already hosts service events like create_bug, delete_bug, update_task etc. If you want to create additional events like create milestone or update timesheet, you can create custom triggers. The created trigger can be used to invoke webhooks to access information from or to third-party services.
 

Parameters

* refers to mandatory fields

Name
Type
Description
auth_type *
String
Authentication type.
encapiKey *
String
Encrypted API key. Note that this must be encoded if tried on Postman API.
sigma_custom_event_uuid *
String
ID of the custom event to be executed.
integ_scope_id *
Long
Portal ID of the Zoho Service.
app_install_id*
Long
Installation ID of the extension.

Request Body

Only JSON and XML content types are allowed in request body. The data passed in the request body will be passed to all functions associated in the Custom Trigger as a payload.  To get the payload inside the DRE function use the command data.get("payload") .
 

Response

Success
  1. {
  2.     "message": "Custom trigger has been added to the queue",
  3.     "status": true
  4. }
 
Failure
  1. {
  2.     "message": "Error in adding Custom Trigger to the queue",
  3.     "status": false
  4. }
 

How to construct Custom Trigger URL in DRE Function?

    Developers can construct Custom Trigger URL inside a DRE function and register it as a webhook in third party services.

  1. info "Constructing Custom Trigger URL in DRE function"
  2. cutsomEventUUID = "86ea3e04-6e0d-4b04-a434-1ee949712909";
  3. invokeCustomTriggerURL = "https://" + data.get("sigma_execution_domain") + "/workspace/invokecustomtrigger?sigma_custom_event_uuid="+cutsomEventUUID+"&integ_scope_id="+data.get("integ_scope_id")+"&app_install_id="+data.get("app_install_id")+"&auth_type=apikey&encapiKey="+data.get("encapiKey”);

  4. info "use the invokeCustomTriggerURL to register webhook on third-party tool"
 

How to execute Custom Trigger using DRE Function?

    Use the below sample Deluge function to execute the Custom Trigger using DRE.

  1. info "Invoking Custom Trigger";
  2. customTriggerExecutionURL = "https://" + data.get("sigma_execution_domain") + "/workspace/invokecustomtrigger";
  3. executeParams = Map();
  4. executeParams.put("sigma_custom_event_uuid", "86ea3e04-6e0d-4b04-a434-1ee949712909");
  5. executeParams.put("integ_scope_id", data.get("integ_scope_id"));
  6. executeParams.put("app_install_id", data.get("app_install_id"));
  7. executeParams.put("auth_type", "apikey");
  8. executeParams.put("encapiKey", data.get("encapiKey"));
  9. executionResponse = invokeurl
  10. [
  11.  url: customTriggerExecutionURL
  12.  type: POST
  13.  parameters: executeParams
  14. ];
  15. info "Custom Trigger execution Response : " + executionResponse;

    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









                                            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

                                                                                                              • Executing Functions using API URLs

                                                                                                                Executing a function via a REST API URL is now supported in Sigma. All you have to do is configure the Function Execution API URL with your function parameters. This helps to listen to third-party application events through webhooks and perform ...
                                                                                                              • About Sigma

                                                                                                                As your company expands, you might add new business processes to your organization and recruit more employees. Having several tools to monitor the development will make managing the organization laborious. Also, if you have to juggle between many ...
                                                                                                              • Create extensions using Command Line Interface(CLI)

                                                                                                                Zoho Sigma helps you to build extensions for Zoho services in two ways: Building apps using the command line interface (CLI). You can use this method if you want to build an extension offline with your own code editor. Use Zoho Sigma cloud editor and ...
                                                                                                              • Create extensions using Zoho Sigma cloud editor

                                                                                                                Sigma has introduced a cloud editor where users can build extensions for Zoho services . Upon selecting a Zoho service, the corresponding service’s plug-in manifest file will be pre-populated into Sigma’s editor as a new project, eliminating the need ...
                                                                                                              • A walkthrough tutorial for building a simple extension using Sigma

                                                                                                                This tutorial's objective is to teach you the fundamentals of Sigma to build an extension. STEP 1: Create your app For this tutorial, let us create a new extension with Zoho Projects service to display 'Hello World' text. This extension will be ...
                                                                                                                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