- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 04:53 AM
Hi Folks,
We have made a field as string by mistake. Now we need to change it to integer. We have stored only integer value in the field also but in string format.
Is there any way to convert the data type as integer.
Thanks in advance.
Vikash
Solved! Go to Solution.
- Labels:
-
Best Practices
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 05:02 AM
HI Vikey,
Fix script sample:
var gr = new GlideRecord("TABLENAME");
gr.addNotNullQuery('INTEGERFIELDNAME');
while(gr.next()){
gr.STRINGFIELDNAME = gr.INTEGERFIELDNAME.toString();
gr.update();
}
post me your feedback
Please Hit ✅Correct, â�ï¸�Helpful, or â�£ï¸�Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 10:59 AM
I know of no such list. If you feel one would be valuable, consider putting in an enhancement request.
Enhancement requests: Tell us how you would improve the ServiceNow product
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 05:10 AM
Where should I search for the data type compatibility list with each other. Is it documented somewhere? if yes. can you please send me the link.
Regards,
Vikash

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 05:15 AM
I am not sure. I don't have any such list. I just tried changing the data type on my personal dev instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 05:23 AM
Hey Vikey,
I tried my solution and it works.
post me your feedback
Please Hit ✅Correct, â�ï¸�Helpful, or â�£ï¸�Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 05:27 AM
The best way to find it if you can change a data field type is to click the magnifying glass on the type field in the dictionary. It will present a list of valid choices. If your target type doesn't appear, you'll have to do the method of creating a new field with the new type.