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, text searches in ServiceNow table columns are case- and accent-insensitive, meaning they treat characters like "A" and "a" or "A" and "Å" as equivalent. Thelocale text matchfeature allows administrators to enforce case and accent sensitivity on a per-column basis, ensuring searches return only exact matches based on case and diacritics.
Show less
This feature requires setting a column attribute and a global system property, and it has been available since the Zurich Patch 9 and Australia Patch 2 releases.
Key Features
- Column attribute
i18nlocaletextmatch: When set to true on a column (of type String, Translated Text, or Translated Field), text searches on that column become case- and accent-sensitive. - System property
com.glide.db.uii18nlocaletextmatch: Must be set to true to enable locale text match behavior in the platform UI for the specified columns. - Overrides SQL collation: Setting locale text match on a column overrides the default SQL collation for queries involving that column.
- Restrictions: The column attribute cannot be set if
i18nsessionlanguagesortableis set on the same column or if the system propertycom.glide.db.sessionlanguagecollationfeatureis true. - Applied globally to queries: Once enabled on a column, all queries—including ACLs and business rules—respect the case and accent sensitivity.
- Multiple methods to control behavior:
- Use
GlideRecord.setLocaleTextMatch(Boolean)in scripts to temporarily enable or disable sensitivity. - Add
sysparmlocaletxtmatch=true|falseto URLs to override sensitivity for specific queries. - Control default UI behavior through the global property
com.glide.db.uii18nlocaletextmatch.
How to Enable
- As an admin, navigate to
sysdictionary.listand locate the target table and column. - Ensure the column type supports the attribute (String, Translated Text, or Translated Field).
- Add the attribute
i18nlocaletextmatch=truein the Attributes field or via the Attributes tab. - Set the global property
com.glide.db.uii18nlocaletextmatchto true to enable UI support.
Practical Considerations
- Thoroughly test case and accent sensitivity after enabling to ensure expected behavior across all queries.
- Locale text match settings have a priority order: URL parameter overrides global property, which overrides default behavior.
- This feature enhances search precision, which is crucial when case or accents differentiate key data entries.
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 and a sys property com.glide.db.ui_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 set the i18n_locale_text_match column attribute when the following attribute is set on the same column: i18n_session_language_sortable or if property com.glide.db.session_language_collation_feature=true. For more information see Sorting according to the session language.
- Test the case and accent sensitive behavior thoroughly. 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 the column's Type. This attribute can be added to String, Translated Text, or Translated Field types.
- In the Attributes field of the column, add i18n_locale_text_match=true. Use a comma separator without spaces. (You might need to switch to the Advanced view of the record to see the Attributes field).
- As an alternative to the previous step, open the Attributes tab in Related Links, then select New. In the Attributes field search for locale text match, then set the Value field to True.
- Select Update or Submit.
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. For information see Explore the REST API for a table.
- Add
- Use case: When the parameter is added, activate or deactivate locale text match (case and accent sensitivity) for queries that display data in platform 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. For text searches in tables in the product UI, both this property and the column attribute should be set to true.
- Default: false
- Use case: Activate or deactivate locale text match (case and accent sensitivity) for queries that display data in the platform 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).