Best Practice to change the type of existing field

Yathvika
Tera Contributor

I would like to change the existing fields type from String to Checkbox and From Integer to Currency,
What is the best way to do this.

Inactivating the Existing fields and creating a new one with the same name is not working as the error is coming up and showing the field with same name exists.

Assist on the best ServiceNow practice approach.

TIA

9 REPLIES 9

Ankur Bawiskar
Tera Patron

@Yathvika 

if these fields are not in production, better to Delete them and re-create with Proper field type

Some field types change is not allowed

If already in production then deactivate older field and create new and store data in new field by running fix script

Simplifying Field Changes in ServiceNow: Tips and Limits 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar  

Yes, Field is already in production. Can you let me know how to store data in new field by running fix script. If there are 5 fields which requires the data type change, then does all the fields requires a script needs to be run in production as well?

Mohammed8
Giga Sage

Hi @Yathvika ,

Even if you are able to change an existing field type from String to Checkbox, it is not a recommended practice  as it can cause hidden issues such as data loss and need to thread carefully

 

The safer approach is to create a new field with the correct data type

If you are receiving an error while creating the new field, it is likely because the system is trying to reuse the same column name. You can keep the same label for the new field, but slightly tweak the backend (column) name to avoid conflicts

 

Thanks and Regards,

Mohammed Zakir

VaishnaviK43271
Tera Contributor

Hi @Yathvika !!

 

  • Do not change the field type directly in production, as it can cause data and script issues.

  • If the table has no important data yet, you can change the field type directly in dev and move it via update set.

  • If data already exists:

    • Create a new field with a different name (same label if required).

    • Migrate data using a fix script / background script (String → Boolean, Integer → Currency).

    • Update forms, scripts, and reports to use the new field.

    • Inactivate or hide the old field (do not delete).

  • You cannot create a new field with the same name, even if the old one is inactive.

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for.

Thank You