Transform Map: Insert multiple records from single source record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2018 09:39 PM
I have an CSV file which has a field that contains a comma separated list of items. I need to create a record in the target table for each item listed in the comma separated list.
For example, a source record may look like this:
Field1: Hyundai
Field2: Verna, I20, Creta
The result in the target table should have a record for each of Field2:
Record1: Field1=Hyundai Field2=Verna
Record2: Field1=Hyundai Field2=I20
Record3: Field1=Hyundai Field2=Creta
Any inputs will be much appreciated.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2018 10:17 PM
you can write on before script and do some string manipulation ...and can insert the record ........
on Before Script;
var f1 = source.field1;
var f2 = [] ;
f2 = soource.field2.split(',')
for(var i = 0; i < f2.length ; f2++)
{
var gr target = new GlideRecord('target Table Name');
gr.initialize()
gr.field1 = f1;
gr.field2 = f2[i];
gr.insert();
}