Changing the variable Type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2024 01:32 PM
Hello All,
We have a variable (Type = Single line text) being used across different catalog items.
The requirement is to change the type to drop-down values (drop down values should be coming from Location table's Country column). Now the problem is Location data is not normalized. Like Country data has country codes as well as country names like BRA, Brazil, IND, India etc. Reference qualifier should pull just country codes. How can we achieve that?
Also, in general is it ok to convert the variable data type from single line text to Choice? will it create any issues like data loss in exisiting records. Note: Exisiting records contains full country names as well. So when we change the variable type, will it create any issues?
Please advise.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2024 01:43 PM - edited ‎06-18-2024 01:45 PM
Here is a link to a KB article that applies to variables as well. It is HIGHLY recommended to create a new variable and not change the type as data loss will occur.
Changing field type or column datatype
As far as the reference qualifier, it sounds like you're going to need an Advanced one with a Script Include, with possible RegEx to strip out unwanted pieces of data, or to clean up your Location data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2024 02:24 PM
Hi @dvelloriy ,
Please refer to below thread:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0712394
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda