How to run a script in a UI Action Condition Field?

catarinapereira
Tera Contributor

Hi,

Is it possible to run a script in the Condition Field in a UI Action?

I need to show a Form Button depending on the status of a record from another table. And that'd be easy to implement if I could write a script in the condition field.

Is there any way to run a script in the Condition field?

Thanks in advance for your help.

5 REPLIES 5

manikorada
ServiceNow Employee
ServiceNow Employee

Yes,



You can have a script include and have the function return true/false.


Use that in your condition field


dravvyramlochun
ServiceNow Employee
ServiceNow Employee

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Catarina,



You should be able to run one line of JS that evaluates to true or false. In the case where you have something complex you can do that in a script include and then call the script include from the condition on the ui action.


Chandu Telu
Tera Guru
Tera Guru

Hi Team,



Please find the below link it may help you



UI Action Condition and Script Include Produces Undefined



Please provide your feedback appropriately (Like, Helpful, Endorse AND/OR Correct) to help community.



Thanks


Cahndu Telu