Set case and accent sensitivity on a per-column basis
Summarize
Summary of Set case and accent sensitivity on a per-column basis
By default, ServiceNow performs text searches on table columns without sensitivity to case (e.g., "A" vs. "a") or accent differences (e.g., "A" vs. "Å"). Thelocale text matchfeature enables administrators to enforce case and accent sensitivity on a per-column basis, ensuring text searches return only exact matches in terms of case and diacritics.
Show less
This capability is available starting from Zurich Patch 9 and Australia Patch 2. When enabled, locale text match overrides the default SQL collation for the specified column.
Important: The attribute i18nlocaletextmatch cannot be used simultaneously with i18nsessionlanguagesortable on the same column. Applying locale text match affects all queries on that column, including ACLs and business rules, so thorough testing is crucial.
How to Enable Locale Text Match on a Column
- Log in with the admin role and navigate to
sysdictionary.list. - Locate the dictionary entry for the target table and column.
- Ensure the column type is String, Translated Text, or Translated Field.
- Add the attribute
i18nlocaletextmatch=trueto the Attributes field or via the Attributes tab.
Additional Methods to Control Locale Text Match
The following options allow enabling or disabling locale text match in specific contexts, applicable only to fields with i18nlocaletextmatch=true set:
- GlideRecord Method: Use
setLocaleTextMatch(Boolean)in scripts to temporarily toggle case and accent sensitivity for queries, such as background transactions. - URL Parameter: Append
sysparmlocaletxtmatch=trueorfalseto URLs to activate or deactivate sensitivity for UI queries including reports, dashboards, and lists. - Global Property: Define
com.glide.db.uii18nlocaletextmatchinsyspropertieswith a value oftrueorfalseto set a default behavior for UI data queries.
Priority Order for Locale Text Match Settings
When multiple controls are applied, the following precedence determines effective behavior:
- Highest Priority: URL parameter
sysparmlocaletxtmatch - Lowest Priority: Global property
com.glide.db.uii18nlocaletextmatch
Practical Benefits for ServiceNow Customers
Enabling locale text match allows precise and culturally accurate text searches tailored to your business needs, which is essential for applications that require strict matching of case and accents in multilingual environments. The ability to control this on a per-column basis provides flexibility without impacting the entire system, allowing targeted refinement of search behavior.
Careful implementation and testing ensure that all UI components and backend processes respect these settings, maintaining consistent and expected search results across your ServiceNow instance.
Set locale text match to provide case and accent sensitivity when searching the text of table columns. The default behavior for text searching in table columns is insensitive to case and accent (diacritic) variations, but you can enforce sensitivity using locale text match.
Overview of locale text match
By default, text searching in table columns is insensitive to case (example: A vs. a) and accent or diacritic (example: A vs. Å).
As an admin, you can modify this behavior for the fields you specify by setting the column attribute i18n_locale_text_match. When set to true, text search on the column retrieves only exact matches for case and accent.
Locale text match is available from Zurich Patch 9 and Australia Patch 2. Setting locale text match overrides the collation of SQL queries for the specific column.
- You can't use the i18n_locale_text_match column attribute when the following attribute is set on the same column: i18n_session_language_sortable. For more information see Sorting according to the session language.
- Be sure to test the case and accent sensitive behavior thoroughly, because when the i18n_locale_text_match column attribute is set the behavior is applied to all queries including ACLs, Business rules, and so forth.
Setting the column attribute i18n_locale_text_match
- With the admin role, navigate to sys_dictionary.list.
- Search for the name of your table and the name of the column to which you want to add this attribute.
- Open the dictionary entry, and confirm that the column's Type is String. This attribute can also be added for the following Types: Translated Text or Translated Field.
- In the Attributes field of the column, add i18n_locale_text_match=true. Alternatively, in Related Links, open the Attributes tab, then select New.
Other methods for locale text match
- GlideRecord: setLocaleTextMatch (Boolean isLocaleTextMatch)
- Where: Used in scripts, such as for background transactions.
- Use case: Temporarily activate or deactivate locale text match (case and accent sensitivity) for a specific GlideRecord query
- URL parameter: sysparm_locale_txt_match
- Where:
Add
sysparm_locale_txt_match=trueorsysparm_locale_txt_match=falseas an extra parameter in a URL.Table API.
- Use case: When the parameter is added, activate or deactivate locale text match (case and accent sensitivity) for queries that display data in the UI including reports, dashboards, platform and workspace lists.
- Where:
- Global property: com.glide.db.ui_i18n_locale_text_match
- Where: Create a property in sys_properties, if it doesn't exist already.
Name: com.glide.db.ui_i18n_locale_text_match.
Type: true | false.
Value: either true or false according to your business requirements.
- Default: false
- Use case: Activate or deactivate locale text match (case and accent sensitivity) for queries that display data in the UI including reports, dashboards, platform and workspace lists.
- Where: Create a property in sys_properties, if it doesn't exist already.
- URL parameter: sysparm_locale_txt_match (highest priority).
- Global property: com.glide.db.ui_i18n_locale_text_match (lowest priority).