- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 08:54 PM
Hi everyone
I am wondering how exactly the gs.getMessage get the message in Message table(sys_ui_message) .
for example, I have four record with the same key as 'request' ,Application with Global are OOB.
Now if I use
function getFilterName(table) {
if (table == 'sc_cat_item')
return gs.getMessage("Request");
what will return ??????? As my test, nothing changed still 'request' returned, I want know how the gs.getMessage work when the same key record exist in the table.
And where can I find the source code of the gs.getMessage fuction??
help me please, thanks!
Solved! Go to Solution.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 11:32 PM
Hi Bai,
a. Go to "Messages" table
b. Filter for a key that has multiple messages ("Request" in your example)
c. Add columns "Key", "Message", and "Update name" in the list view
d. Sort the list in ascending order by "Update name"
The one you see at the top is the message that will be displayed.
I hadn't explored this before but ran a few tests today to identify the pattern and this seemed consistent.
On a related note, I would refrain from adding multiple messages for the same key in the same language.
Thanks,
Arav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 09:09 PM
It works based on the the language the user chosen in their profile.
You can find the sequence on which the language for the logged users are identified in the link given below,
https://docs.servicenow.com/en-US/bundle/sandiego-platform-administration/page/administer/localization/concept/c_LangInternationalizationSupport.html
Thanks & Regards,
Vasanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 09:09 PM
Hi there,
Reading this, gs.getMessageLang() sounds better to me:
- 2021-07-01 Return a message in a specific language, gs.getMessageLang()
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2022 10:19 PM
thanks for answering !!
Glad to know about gs.getMessageLang() and I will use it when I need.
Maybe the capture have Japanese message made it confusing.....
What I want to know is , regardless of the Language, when there are two records with same key but in different scope, whitch one will the gs.getMessage get
If I can check the source code of the gs.getMessage I will konw it , but I cant find....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 12:11 AM
It feels a bit weird to have multiple UI Messages with the same key and language. I know it's not prevented from adding such, though it would get out of control in my opinion.
Do prevent such from happening.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field