how to restrict the kb article based on language in portal

AshishD18291065
Tera Contributor

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

4 REPLIES 4

Ankita_Patil
Tera Contributor

Hi  @AshishD18291065 ,

Use this in your Search Source condition
language = ${user.language}

Thank You !
Ankita Patil

Ankur Bawiskar
Tera Patron
Tera Patron

@AshishD18291065 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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. 

@AshishD18291065 

Glad to help.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader