After importing data into the sys_choice table using Excel, the Value field is not populated correct

Koki Sugimori
Tera Contributor

After importing data into the sys_choice table using an Excel file, I am facing a problem where only the Value field is not populated with values correctly and all the values are replaced with numbers.

 

When I try with PDI, the data is imported correctly as per the Excel file, but in the demo instance, the Value field is all replaced with numbers.

Since the PDI is importing the data correctly, I do not think there is anything wrong with the Excel file itself.

 

My apologies if I have not explained it well enough.

Can anyone assist me with the above problem?

 

Best regards and thank you in advance for your help.

1 ACCEPTED SOLUTION

@Koki Sugimori 

Since that field is of type Integer hence you are facing the issue

If you are not allowed to change the field type, then delete that field and create a new one with same name and of type String

Then load and it should work fine

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

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

View solution in original post

16 REPLIES 16

Hello @Koki Sugimori 

 

You need to check it in dictionary table what is the field type of this field - I am sure it's integer. That's why it's converting to corresponding integer values. 

 

You need to change that to string. Import set table field types should always be string irrespective of the actually data type of field to avoid such type of confusion. Because it ultimately picks up backend values. And registers. 

 

So if you have integer type - then you will need to change the existing records value to string first, rhen only it will allow to convert to string and then it can successfully go. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

@Shivalika 

Thank you.

 

So if you have integer type - then you will need to change the existing records value to string first, rhen only it will allow to convert to string and then it can successfully go. 

 

When you say convert the value of an existing record to a string, do you mean convert the Value column of the sys_choice table to a string? If so, then it is already a string.

 

On the other hand, am I correct that you are converting the Value column of the u_imp_tmpl_sys_choice table from an integer type to a string?

 

Also, does the conversion to a string have any effect on the existing records in the sys_choice table?

@Koki Sugimori 

the import set field which holds the value should be of type String and not Integer

Did you check that?

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

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

@Ankur Bawiskar 

Does this mean that the type here must be a String type?

KokiSugimori_1-1744792804622.png


When I try to change to String type, I get the following error message

 

Error MessageType change not allowed. Invalid type conversion for field ‘Value’ on table ‘Imp Tmpl Sys Choice’. Cannot convert from ‘Integer’ to ‘String’.

@Koki Sugimori 

Since that field is of type Integer hence you are facing the issue

If you are not allowed to change the field type, then delete that field and create a new one with same name and of type String

Then load and it should work fine

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

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