We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

In service operation workspace can we show feild message in french

prem kumar2
Tera Contributor

Hello
iam facing issue with a show feild message to dispaly it in french when a french user logged in 

premkumar2_0-1740128938529.png

i have tried using 
if(g_lang=="en"){

//put english text

}else{

//put french text
}

but this script is not working out in workspace is any other way we can figure it out


 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@prem kumar2

1) Create the message translation in the sys_ui_message table
2) Create Records with languages you need

3) use this script

getMessage("YOUR_MESSAGE_KEY", function(msgString) {
                g_form.showFieldMsg('field_name', msgString, 'error');
            });

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

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

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron

@prem kumar2

1) Create the message translation in the sys_ui_message table
2) Create Records with languages you need

3) use this script

getMessage("YOUR_MESSAGE_KEY", function(msgString) {
                g_form.showFieldMsg('field_name', msgString, 'error');
            });

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

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