Need to call script include in condition box in action assignment

shrngikaG
Tera Contributor

shrngikaG_0-1740036445568.png

 

3 REPLIES 3

Community Alums
Not applicable

Hi @shrngikaG 

Script Condition (Server-Side): The server-side condition is evaluated next. If it returns false, the action will not be displayed, regardless of the client or record conditions.

You can use following approch to call script include in it:

new ScriptIncludeName.MethodName(paramenters)

 

Ankur Bawiskar
Tera Patron
Tera Patron

@shrngikaG 

it's like normal UI action condition field

You can use server side syntax

new ScriptInclude().functionName()

What's your issue?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Anshul Shrivast
Tera Contributor

Hi @shrngikaG 

 

Please see below solution.

 

Once you have your Script Include set up with the new method, you can call it in the condition field of your UI Action like this: new conditions_hidestudbutton(). shouldDisplayButton(); This line will instantiate your conditions_hidestudbutton class and call the shouldDisplayButton method.

 

If above solution is helpful for your, Please mark as helpful and accept the solution.

 

Thanks

Anshul