Can't add getmessage() to UI Action

Abbottronix
Tera Guru

I'm trying to update the Create Normal Change UI action, so that it auto-fills some fields in the new change with text I've saved as messages. However, whenever I add getmessage() to the script, the UI action fails. I see other UI action scripts that use getmessage(), so I don't understand what the problem is. 

 

Screenshot 2025-04-11 155333.jpg

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Abbottronix 

the syntax is wrong.

if your UI action is server side then use this syntax

gs.getMessage('your key here');

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

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Abbottronix 

the syntax is wrong.

if your UI action is server side then use this syntax

gs.getMessage('your key here');

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

Thank you that fixed it