Detect user working in UI or Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 02:09 PM
Hi everyone,
does anyone know whether it's possible to detect whenever a user is switching between the classic UI and the Service Portal (not login & logout)?
Kind regards,
Stijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2020 08:35 PM
Hi,
you can use the condition in business rule and check the url contains specific keyword
gs.action.getGlideURI().toString().indexOf('/sp') != -1
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello Ankur,
Based on above topic i have a below requirement ;-
Automatic assignment of Source = "Portal"
-- When employees report SIRs via sir.boat.com (Portal), the source should automatically be set to "Portal".
- Similarly if any SiR analyst raise incident from classic Ui the source should be set to backend.
note:- We have portal and backend choices in Source field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2020 10:48 PM
Hi tantony,
Changes on the form are on the client side. Business rules are on the server side, they are processes after the form has been submited and the server side codes runs. So you can't handle form changes in a business rule.
On the client side you have to work with client scripts (and e.g. with ajax calls to the server side).
On the server side (business rule, after submit) you can have my code above as condition to make sure that the change is comming from the Service Portal and current.field_name.changes() to see if the field you're looking for got changed.
All the best,
Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2020 03:29 PM
I could not get it work on Service Portal on my personal instance since the URI did not have the string 'api/now/sp' .
gs.addInfoMessage(gs.action.getGlideURI().toString());
Above statement displayed:
" api/now/v2/table/sys_user/6816f79cc0a8016401c5a33be04be441?api=api&sysparm_display_value=all&sysparm_fields=email"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hello Fabian,
Based on above topic i have a below requirement ;-
Automatic assignment of Source = "Portal"
-- When employees report SIRs via sir.boat.com (Portal), the source should automatically be set to "Portal".
- Similarly if any SiR analyst raise incident from classic Ui the source should be set to backend.
note:- We have portal and backend choices in Source field.
