Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Filter using user's language

Pascal Verdieu
Mega Sage

Hello All, I have a catalog item variable which looks up the sys_choice table for a list of choices.  Thing is that if there are several languages, there are duplicates.  I would like the list to filter down to the user's language setting.  Is that possible?  I looked at the javascript:gs.getUserID() and the DYNAMIC90d1921e5f510100a9ad2572f2b477fe options but they don't seem to provide some insight on the current user's language.

 

Ideas?  Tkx

1 ACCEPTED SOLUTION

Sebas Di Loreto
Kilo Sage

Let me try to help here by explaining what would be the query on the sys_choice table if I want to get the choices for the category field on the incident table in English: element=category^name=incident^language=en

If you want to get the language dynamically for the user, then you can use: gs.getUser().language

That code will give "en" if you are using English.


If I helped you with your case, please click the Thumb Icon and mark as Correct.


View solution in original post

3 REPLIES 3

Sebas Di Loreto
Kilo Sage

Let me try to help here by explaining what would be the query on the sys_choice table if I want to get the choices for the category field on the incident table in English: element=category^name=incident^language=en

If you want to get the language dynamically for the user, then you can use: gs.getUser().language

That code will give "en" if you are using English.


If I helped you with your case, please click the Thumb Icon and mark as Correct.


Hi, just to have the reference in a picture:

SzTamas_0-1727176045444.png

 

 

Pascal Verdieu
Mega Sage

Thanks Sebastian,

For reference, I set the code as:

javascript:'element=category^name=incident^language='+gs.getUser().language