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

Can a UI be triggered automatically, with actually clicking on a link? We want to be able to click on the UI and also to have it trigger automatically when conditions are met.

PaulShea
Kilo Explorer

It has been asked if a UI can be triggered automatically, without actually clicking on a link.

I know both a UI and a Business rule can call the same script include and that's a possible solution.

But someone here would like to have the UI itself be used as a UI, where the link is clicked and the script is run.

And also would like the UI to be launched without clicking on a link.

The person would like the UI to be launched when conditions are met, like a state changing to a specific value.

Can a UI be triggered to run like a business rule?   To get launched without clicking on a link?

Thanks,

Paul

8 REPLIES 8

Srinivas Balusu
Kilo Guru

Yes you can.



1. Call the script include form the business rule.


2. In the business rule use 'action.setRedirectURL()'


Hi Srini,


I may be missing something or did not explain myself very well.


I was wondering if it's possible to launch a UI action without actually pressing the UI link.


Thanks,


Paul


206 654-3644


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Paul,



The answer is no you cannot technically execute a ui action without being on the form, but you should still be able to accomplish your requirement. You can take whatever code is in your ui action and move it into a script include, then call that from the ui action. The advantage that gives you is that you can call that script include from any server side code, include business rules, scheduled jobs, workflow scripts, scripted rest api, script actions, etc.


Too fast Brad