- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I want when an request Item is created specially on workspace and Service desk agent clicks on SAVE then Source (contact_type) field should be Email, other wise when uses service portal then Source (contact_type) field should be Portal , tried through Client script it's working fine for portal but not on workspace.
Any suggestion how to acheive
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
You can replace your onSubmit Client Script with a Before-Insert Business Rule.
- Name: Set Contact Type by Source
- Table: Requested Item (sc_req_item)
- When: Before
- Insert: Checked
- Update: Unchecked
- Condition: contact_type is empty
(function executeRule(current, previous /*null when async*/) {
var action = gs.action.getGlideURI().toString();
var isWorkspace = action.indexOf('$sw.do') > -1 || action.indexOf('agent_workspace') > -1;
if (isWorkspace) {
current.contact_type = 'email';
} else {
current.contact_type = 'portal';
}
})(current, previous);
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
how are the agents creating RITM from workspace?
are they submitting request from workspace?
share your screenshots, script and form etc
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
whener we recieve any email through interaction we have given option to create req item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
then you can try to use onLoad client script on sc_req_item and see if the URL contains workspace name, if yes then set the contact type
did you try above approach?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I tried that but somehow it's breaking for service portal then ,
I want particularly for sow workspaces it should be email , rest for service portal as Portal..
Please find the script below