Notification Profile Custom Function

Notification Profile Custom Function

In Zoho IoT, notification profiles are configurations that determine how and when notification related actions should be executed in response to alarms - either when a new alarm is created or when its status changes (severity, acknowledgement, resolution, etc.). A custom function linked to a notification profile enables you to implement tailored business logic or integrations whenever those alarm events occur.

This document explains how to create a notification profile custom function, how to associate it with a notification profile, and provides an example code demonstrating its use.

Creating a notification profile custom function

To create a notification profile custom function,
  1. Click Add Custom Function.



  2. Select Notification Profiles in the Category field.



  3. Provide the required details in the appropriate fields.
Example -
Language : Deluge
Model/Module: All Device Models (Select the model on which the device, asset, or location is based on)
Display Name: Create Device Disconnect Work Order (Provide a name of your choice)
Function Name: create_disconnect_work_order (Provide a name of your choice)
Description:  A custom function to create a work order every time a gateway device is disconnected from the application. 



  1. Click Save. This will open the Code Editor.



  2. Provide the required code.



  3. Click Save and Close.


Notification Profile Custom function sample code

Below is an example of how notification-profile custom functions can be used to automate actions when alarm-related events occur. In this scenario, the notification profile includes two custom functions: one that creates a new record whenever a gateway device is disconnected, and another that escalates a specific field value from High to Urgent when the alarm’s severity changes. Because the notification profile is triggered by these alarm events, both custom functions run automatically, ensuring timely record creation and proper escalation without requiring manual intervention.

This custom function creates a work order every time a gateway device disconnects. This is configured as the notification action.

json_string = {"workorder":{"Name":"Reconnect " + gateway_name,"Gateway_Name":gateway_name,"Gateway_Location":gateway_location,"Order_Status":"High","Alarm_ID":alarm_id},"Gateway_ID":gateway_id};
response = invokeurl
[
url :"https://app12345akyrw.zohoiot.com/iot/v1/workorder"
type :POST
parameters:json_string + ""
connection:"iot-connection"
];
info response;
This custom function updates work order status to Urgent if the issue isn't fixed within the define limit. This is configured as the escalation action.

filter = {"condition_text":"1","conditions":{"1":{"field":{"api_name":"Alarm_ID"},"comparator":"equal", "value":alarm_id}}};
get_url = appUrl + "/iot/v1/workorder?filter=" + encodeUrl(filter);
response = invokeurl
[
url :get_url
type :GET
connection:"iot"
];
workorder_id = response.get("workorder").get(0).get("id");
status_response = response.get("workorder").get(0).get("Order_Status").get("display_value");
if(status_response == "High")
{
json_string = {"workorder":{{"id":workorder_id,"Order_Status":{"display_value":"Urgent"}}}};
response_put = invokeurl
[
type :PUT
parameters:json_string + ""
connection:"iot"
];
info "RESPONSE:: " + response_put;
}

Associating to a notification profile

Once the custom function is created, it becomes available for selection when configuring a notification profile. You can associate the custom function in the Choose Actions field while creating or editing a notification profile.

While adding/editing a notification profile,
  1. Click Choose Action. This opens the Notification, Escalation, or Resolution action panel, depending on the action you want to configure.



  2. Click Add Action.



  3. Select Custom Function in the context menu.



  4. Select the required custom function and click Associate.



  5. Click Save in the action panel.



  6. Click Save in the notification profiles form.


The custom function will now be executed each time the notification profiles conditions are met.

      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 FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile 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 FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure Forms

                              TypeformWCAG


                                          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

                                                                                                                            • Working with Notification Profiles

                                                                                                                              Notification Profile actions can be triggered based on various conditions. This document provides steps to create and automate notification profile actions under the Notification, Escalation, and Resolution action sections. Refer to the Understanding ...
                                                                                                                            • Understanding Custom Functions

                                                                                                                              Custom functions in Zoho IoT allow you to extend the platform's capabilities. These functions are written using various programming languages and are easy to construct. With custom functions, users can move beyond the default offerings of the ...
                                                                                                                            • Adding and managing custom functions

                                                                                                                              Adding Custom Functions A custom function can be added for one of the below listed categories, each corresponding to a specific feature in the application. Once created, the custom function becomes available for the feature in the selected ...
                                                                                                                            • Alarm Rule Custom Function

                                                                                                                              When an Alarm Rule is configured in Zoho IoT, you define the condition under which the alarm should be raised. As part of this configuration, you can specify a custom function to run as the end action. Each time the alarm is triggered, the associated ...
                                                                                                                            • Configuring Push Notification

                                                                                                                              Note: The Push Notification feature is currently in its beta stage with further enhancements planned in the product roadmap. Contact support@zohoiot.com for more details. Push notifications are the preferred action for delivering real-time alerts ...
                                                                                                                              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