how to restrict the kb article based on language in portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
how to restrict the kb article based on language in portal,
I have added a query language starts with "javascript: gs.getUser().getLanguage()" this in search Source. But on the portal/employee Center, it is showing all the KB articles with all the Languages. But I am expecting only with user logged / preferred language KB only should show on the portal after searching.
looking for expert advise?
Thanks,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @AshishD18291065 ,
Use this in your Search Source condition
language = ${user.language}
Thank You !
Ankita Patil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
by default the search happens based on logged in user's language only
check this
Assign Knowledge article search languages by country
you should use this to get the session's language
gs.getSession().getLanguage()
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
3 weeks ago
Hi @Ankur Bawiskar , Thank You for the response. But I have tried gs.getSession().getLanguage() as well but not working as expected. As this return language code so I have used script include as well to fetch the name of language from "sys_language" as well still in the portal it's not working.
I will definitely try Assign Knowledge article search languages by country, this Thank for the approach solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Glad to help.
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