Why does import adds columns with 'u_' prefix?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2016 08:37 AM
I'm working on a scoped application. I'm trying to import data in ServiceNow via an XML file. I have created an import set table with all possible columns and have defined transform map to transform this data into ServiceNow tables.
However when I execute an Import, the import process ignores my columns in the staging/import set table and adds new columns with 'u_' prefix. Why does it do this?
I could find the property glide.import_set_row.dynamically_add_fields which could prevent creation of new columns but I'm not sure if disabling this option would force import to use my columns, my guess is import would fail.
My question is why does the import creates new columns when I have columns in the import set table and if I disable dynamic creation of columns how could I instruct import to use my columns?
Thanks,
Vipin
- Labels:
-
Integrations
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 03:02 AM
Hi Vipin,
I understand we may foresee few issues in the future after upgrades if we have custom fields without prefix 'u_'.
But if we create them as a part of a web service, I am not sure how far an upgrade can impact.
If you still want to proceed, You can use the following script and run it from background or Fix Scripts.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var attrs = new Packages.java.util.HashMap();
var fieldName = 'Name of the field';
var ca = new GlideColumnAttributes(fieldName);
ca.setType('string');
ca.setUsePrefix(false); // If you set this to TRUE, 'u_' will be added as prefix
attrs.put(fieldName, ca);
var tc = new GlideTableCreator('Table Name', 'Table Label');
tc.setColumnAttributes(attrs);
tc.update();