Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to get current domain name which is set by domain picker using script.

MH3
Tera Contributor

Hi All,

Is there any way where I can get the current domain name which is set in the domain picker using script.

 

Thank you in advance.

1 REPLY 1

LukeV7571479230
Tera Guru

I use this as a display business rule on the task table, very handy to have when needed.

 

g_scratchpad.user_domain = {id: gs.getUser().getDomainID(), display: gs.getUser().getDomainDisplayValue()};
g_scratchpad.task_domain = {id: current.sys_domain.getValue(), display: current.sys_domain.getDisplayValue()};