Hiding Short Description based on User Language
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2025 01:49 AM
how to configure ServiceNow to hide the short description of a catalog item when the user's language is Spanish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2025 12:43 AM
Thanks for your response. I tried the solution you provided, but it didn't work as expected. I would like to hide the "Short description" on the portal when the user's language is Spanish, which is highlighted in red. Could you please provide any other solutions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2025 07:28 AM
then it's not possible without DOM
Do this
1) have a variable of type HTML or Rich Text and show that short description inside that
2) then use the script I shared to hide it based on language
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2025 12:39 AM
Thanks for your response. I tried the solution you provided, but it didn't work as expected. I would like to hide the "Short description" on the portal when the user's language is Spanish, which is highlighted in red. Could you please provide any other solutions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2025 08:41 AM
Hi @sravanku888 ,
You can achieve your desired outcome by using two methods:
Solution 1: Using OnLoad Client Script
You can use an OnLoad client script on your catalog item to hide a variable based on the user's language. Here's a sample script:
function onLoad() {
var userLanguage = g_lang;
if (userLanguage == 'es') {
g_form.setDisplay('variableName', false);
}
}
This script checks the user's current language (e.g., 'es' for Spanish) and hides the specified variable if the condition is met. Make sure to replace 'variableName' with the actual name of your variable.
Solution 2: Using UI Policy
Alternatively, you can achieve this using a UI Policy for better maintainability:
Create a UI Policy on the catalog item.
Set the Conditions as:
Requested for.language = Spanish
In the UI Policy Actions section, set the desired variable to Hidden.
This approach is more admin-friendly and keeps your business logic in a centralized place.
If my response was helpful, please mark it as the correct answer and close the thread. This will help others who come across the same issue.
Thanks!
Gaurav Rathaur