The CreatorCon Call for Content is officially open! Get started here.

How to trigger notification from UI Action without generating an event

Vinod40
Tera Contributor

Hello All,

We need to trigger an notification from UI Action without event generation. In Notification the 'Send When' field is set as 'Triggered'. 

Thanks in advance for the help !!! 

find_real_file.png 

1 ACCEPTED SOLUTION

You can trigger flow action which has creates notification from UI action using Flow API which will trigger your existing notification.

 

(function() {
	
  try {
    var grIncident = new GlideRecord('incident');
    grIncident.get('57af7aec73d423002728660c4cf6a71c');

    var inputs = {};
    inputs['variable'] = grIncident;

    sn_fd.FlowAPI.startActionQuick('global.update_record_test', inputs);

  } catch (ex) {
    var message = ex.getMessage();
    gs.error(message);
    }
	
})();

 

https://docs.servicenow.com/bundle/orlando-application-development/page/app-store/dev_portal/API_ref...

 

Regards,

Sachin

View solution in original post

6 REPLIES 6

sachin_namjoshi
Kilo Patron
Kilo Patron

Triggered means when it's triggered by action in flow designer.

 

You can use triggered option only with flow designer.

In your case, you can generate event from UI action and make your notification trigger on event.

 

Regards,

Sachin

Hello Sachin, Thanks for the response.

We already have a notification with 'Send When' as 'Triggered' and the notification is been triggering from a Flow (the Flow has other actions as well).

As part of my new requirment, We created UI action button and when someone clicks the UI action button it needs to send the same notification.

I don't want to create another flow just to trigger this notification. So I am looking for some code reference to send notification from UI action itself.

 

You can trigger flow action which has creates notification from UI action using Flow API which will trigger your existing notification.

 

(function() {
	
  try {
    var grIncident = new GlideRecord('incident');
    grIncident.get('57af7aec73d423002728660c4cf6a71c');

    var inputs = {};
    inputs['variable'] = grIncident;

    sn_fd.FlowAPI.startActionQuick('global.update_record_test', inputs);

  } catch (ex) {
    var message = ex.getMessage();
    gs.error(message);
    }
	
})();

 

https://docs.servicenow.com/bundle/orlando-application-development/page/app-store/dev_portal/API_ref...

 

Regards,

Sachin

Thanks Sachin, I have add the code to trigger the action and it worked as excepted.