Set user Criteria based on User language setting for widgets

kpanchal
Tera Contributor

Hello,

I want to set a user criteria for my "Contact Us" widget based on the user language settings.

For eg: If it's French - Canada it's visible and if it's English, it's not visible. For the English one, it's the reverse

How can I achieve it?

 

kpanchal_0-1695150811088.png

 

2 REPLIES 2

Alex Coope - SN
ServiceNow Employee
ServiceNow Employee

@kpanchal,

Ok, so I think there might actually be a super simple way to achieve what you want, without user-criteria.

In your custom widget, if the text (even if it's HTML) is wrapped in a message call (for a widget it would be wrapped in ${} ), then the entries in [sys_ui_message] would achieve what you want by default (per user session Language).

 

You can be as detailed as you want, e.g. 1 string per line of text (which can have the same phone number or not, entirely your choice) or the whole paragraph. Whilst this blog post isn't describing your exact scenario, I do go through and explain how you can leverage the Message API to do something very similar,


Many thanks,
kind regards

--------------------------------------------------------------------
Director of Globalization Deployment, Internationalization

Palash_Sarkar
ServiceNow Employee
ServiceNow Employee

Hi @kpanchal 

"Contact Us" widget OOTB not found. Is this a custom widget used in the Service Portal?
Please provide a little more information.