Error in update set "Type change not allowed."Cannot covert from string to reference

Raghavendra
Tera Expert

Hi 

Actually, I had 2 fields namely "Application" &"Original request" on exceptions table. Both are string fields. Now I have deleted that both variables and created new variables with type reference field. And i captured that in update set. When I moved the update set from DEV to UAT. I'm getting error like TYPE CHANGE NOT ALLOWED.INVALID TYPE CONVERSION FOR FIELD "APPLICATION" ON TABLE "EXCEPTIONS". CANNOT CONVERT FROM STRING TO REFERENCE. THERE EXISTS DATA RECORDS (16) THAT ARE NOT A SYS ID

Can anybody help me on this

1 ACCEPTED SOLUTION

Hi @Raghavendra 

 

As mentioned, find those 16 incident record on UAT instance which has String value in 'Application' field, and clear it's value.

 

Then again Preview your update set where you are getting error. This time error should not occur for Type conversion and you can commit the update set and verify field configuration.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

View solution in original post

9 REPLIES 9

Hi @Raghavendra 

 

As mentioned, find those 16 incident record on UAT instance which has String value in 'Application' field, and clear it's value.

 

Then again Preview your update set where you are getting error. This time error should not occur for Type conversion and you can commit the update set and verify field configuration.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Hi Anubhav,

It means can i delete those two variables in UAT and then can i pull the updateset to UAT

Hi Anubhav

i tried by clearing the 5 records value.Now the error value reduced from 16 to 11. It is working. Now i will try with remaining and let you know

Raghavendra
Tera Expert

Hi Anubhav,

 

Thank you so much for your quick and accurate solution.

RiteshSwarnakar
Giga Guru

Background Script to find out those which are not sys_id :

var ga = new GlideAggregate('table_name');           
var c = 0;
ga.groupBy('field_name');
ga.query();
while (ga.next()) {
if (ga.field_name.toString().length!=32){
gs.print(ga.field_name);
c+=1;
}}
gs.print(c);