Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to detect user working on UI or Portal

Supriya25
Tera Guru

Hi All,

Kindly help me here,
gs.action.getGlideURI().toString().startsWith('api/now/sp'); in ServiceNow ,
will this code like detect Custom Portal ? how it detect custom portal(/abcdef)? when I open record, when I raise request from /abcdef portal.

or which is right way to identify

on Table Record - OnSubmit Client script - UI type : ALL
Isolated Script = True

I want to run set of code when user perform any activity (example : update Category = Hardwarre)  in Portal , other different set of code when he perform same activity (example : update Category = Hardwarre) from UI .

2 REPLIES 2

maheshkhatal
Mega Sage
Mega Sage

@Supriya25  You need to look for syslog_transaction table. 

You need to watch on URL signatures like sp or /nav_to.do

Mark my response as helpful if it helped you.

Thanks,

Mahesh.

Hi ,
I didn't get you , why do we need syslog_transaction table?

I'm looking for the solution , there want to execute two different blocks of code from single OnSubmit client script.

I found some references already : https://www.servicenow.com/community/servicenow-ai-platform-forum/detect-user-working-in-ui-or-servi...

https://www.servicenow.com/community/developer-forum/how-to-script-if-serviceportal-client-script/m-...

in my case mine is not /sp OOB portal , my portal is Custom Portal /abcdef. 

will this Window===null works for all types of Portals or Only OOB portal /sp.