- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 04:37 AM
Hi All,
I have a requirement, where would like to show some message with different links on a catalog item.
For eg. If I am ordering catalog item from selfservice view, I need to have a different message.
and when it is ordered from portal, it should be a different message.
Thanks
Nayan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 04:58 AM
Hi @nayanmule,
When you mention you'd like to display a different 'message'. Can you expand a little on. what you mean by 'message' please?
Are you referring to a subset of text within the Description for example? Or are you referring to a popup message which displays after an activity such as a change of value?
Don't forget you have UI Policies and Catalog Client Scripts at your disposal whereby you can show and hide fields and display messages based on the 'UI type'. When you select 'Desktop, this refers to the native and backed Self Service view, where as 'Mobile / Service Portal' refers to the front end 'Portal' view.
See below screen shot for guidance.
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 04:48 AM
You could create two onLoad or onChange Catalog Client Scripts, one with the UI Type set to Desktop (for the native UI / self-service view), the other Mobile / Service Portal. If using a one script approach, there are a few different ways to identify Service Portal vs native UI
if (this) { //Service Portal method
//portal message
} else {
//self-service message
}
if(window == null){//Service Portal
//portal message
} else {
//self-service message
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 04:58 AM
Hi @nayanmule,
When you mention you'd like to display a different 'message'. Can you expand a little on. what you mean by 'message' please?
Are you referring to a subset of text within the Description for example? Or are you referring to a popup message which displays after an activity such as a change of value?
Don't forget you have UI Policies and Catalog Client Scripts at your disposal whereby you can show and hide fields and display messages based on the 'UI type'. When you select 'Desktop, this refers to the native and backed Self Service view, where as 'Mobile / Service Portal' refers to the front end 'Portal' view.
See below screen shot for guidance.
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 05:08 AM - edited 03-04-2025 05:09 AM
Hello @nayanmule
For this requirement, you can use an if-else block to display different messages based on where the catalog item is being ordered from:
if (window === null) {
// For portal
} else {
// For Native UI
}
Catalog Client Script Configuration:
- UI Type = All
- Isolate Script = False
Execution:
- The if block will be executed in the Service Portal.
- The else block will be executed in the Native UI.
For more details, refer to Top Window Document Objects in Native UI and Service Portal
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 05:11 AM
you can have 2 Rich Text variables and then hide 1 for portal and 1 for native
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader