Multilanguage search of KB in contextual search

Astik Thombare
Tera Sage

Hi Community,

 

We're working on HRSD and have a requirement from our business users. Currently, in the Related Search Knowledge Article popup, there is an option to select different languages. However, when an agent selects an article in another language, the system still generates the article link based on the current logged-in user's language.

 

The requirement is that if the agent selects a language, such as French, the system should provide the link to the article in the selected language instead of defaulting to the user's language.

 

Below is the screenshot for reference:

 

AstikThombare_0-1728062573022.jpeg

 

Any insights or suggestions are appreciated!

 

@ @Community Alums  @Sandeep Rajput 

 

1 ACCEPTED SOLUTION

Astik Thombare
Tera Sage

Hi ,

 

We found that attachments to HR cases always link to the KB article in the current user's default language due to an out-of-the-box feature. As a workaround, users can scroll down to the "Share Link" or "Copy Permalink" related link, which allows them to copy the specific KB article link. Additionally, we have configured an onChange client script for the Additional Comments field that converts the KB article link into the desired Employee Center link.

 

AstikThombare_0-1728741596800.png

 

AstikThombare_1-1728741632301.png

 

Thanks,

Astik Thombare

 

 

View solution in original post

2 REPLIES 2

sadif_raja
Tera Guru

Hi @Astik Thombare 

To meet the requirement where the system should provide the article link in the selected language (rather than the user's default language) for the **Related Search Knowledge Article** popup in HRSD, you can follow these steps:

Solution Steps:

1. **Modify the Knowledge Article Retrieval Process**:
- The system is currently generating the link based on the logged-in user's language. You need to modify the logic that constructs the article link to respect the language selected in the popup.

2. **Customizing the Related Search Knowledge Widget**:
- Identify the **UI Script** or **Widget** responsible for rendering the Knowledge Article links in the popup.
- Modify the JavaScript in the widget to include the selected language parameter when generating the article link.

Example (assuming the selected language is stored in a variable `selectedLanguage`):
```javascript
var articleLink = "/kb_view.do?sys_id=" + articleId + "&sysparm_language=" + selectedLanguage;
```

3. **Check for Existing Language Options**:
- Ensure that the language chosen in the popup is passed as a parameter to the article link.
- If needed, you may need to add an **onChange client script** or modify an existing one to capture the selected language and update the link accordingly.

4. **Testing**:
- After implementing the change, test by selecting different languages and ensure the article link is updated with the correct language code.

Alternative (URL Parameter Method):
- Another method could be using the **URL parameters** to pass the language code directly in the article link. When constructing the article URL, append the `sysparm_language` parameter based on the selected language from the dropdown.

Example URL:
```plaintext
https://instance.service-now.com/kb_view.do?sys_id=<article_id>&sysparm_language=fr
```

By following these steps, the system will generate the knowledge article link in the language selected by the agent, rather than defaulting to the user's language.

Let me know if you need further guidance on implementation!

Astik Thombare
Tera Sage

Hi ,

 

We found that attachments to HR cases always link to the KB article in the current user's default language due to an out-of-the-box feature. As a workaround, users can scroll down to the "Share Link" or "Copy Permalink" related link, which allows them to copy the specific KB article link. Additionally, we have configured an onChange client script for the Additional Comments field that converts the KB article link into the desired Employee Center link.

 

AstikThombare_0-1728741596800.png

 

AstikThombare_1-1728741632301.png

 

Thanks,

Astik Thombare