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

UI Action to Redirect to a URL

nagaraju8
Kilo Guru

Hi All,

I have a requirement, based on user subregion ess portal page will appear i.e when we click on a UI button first it check the user subregion and redirects to that specific ESS portal page. How to do it please any one help me.

Regards,

Nagaraju    

1 ACCEPTED SOLUTION

ghsrikanth
Tera Guru

From UI Action, you can always query server side GlideRecord script -



var userId = gs.getUserID();



var grUser = new GlideRecord('sys_user');


if(grUser.get(userId)){


var userRegion = grUser.region;


//you can use userRegion here


}



An example UI action with gliderecord query in out of box -


https://instancename.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=399b3492d701310013ab49547...



Mark if it is helpful or correct, feedback is appreciated


View solution in original post

8 REPLIES 8

ghsrikanth
Tera Guru

From UI Action, you can always query server side GlideRecord script -



var userId = gs.getUserID();



var grUser = new GlideRecord('sys_user');


if(grUser.get(userId)){


var userRegion = grUser.region;


//you can use userRegion here


}



An example UI action with gliderecord query in out of box -


https://instancename.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=399b3492d701310013ab49547...



Mark if it is helpful or correct, feedback is appreciated


Hi srikanth,



It is working fine.Thank you so much for your information.



Regards,


Nagaraju


Its great to hear that its working, thanks for your feedback. Happy Scripting


Hi Srikanth,



Thanks a lot once again.



Regards,


Nagaraju