Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to remove prefix for number variables for existing records in Incident table

Shawn33
Tera Expert

How to remove prefix for number variables for existing records in Incident table,
Example: usually number like INC0010043, but my requirement is to remove prefix "INC" for existing records and number should be like 0010043.  

1 ACCEPTED SOLUTION

I would inform customer that this requirement should not be taken as it disturbs the OOB number maintenance + prefix logic on incident table

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

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

View solution in original post

9 REPLIES 9

VaranAwesomenow
Mega Sage

you can write a script, algorithm below

glide record on incident

var numberstring = grinc.number

incnumsubstring = substring(take number after first 3 characters of numberstring).

set grinc.number = incnumsubstring

 

This will only update existing records, if you want all future records to also not have prefix, then you need to update the prefix to empty.

 

But may I ask why this is being attempted ?

client requirement

is that code for only one record or for all existing records?

its a gliderecord so it will apply to all records that are part of the query