Join multiple rows in one record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 04:32 AM
Hello!
Can you please tell me how can I merge 3 rows into one using a transform map?
For example, imported data:
Field1 | Field2 |
123 | Ba |
123 | Bo |
123 | Bu |
Expected output (created record):
Field1 | Field2 |
123 | Ba,Bo,Bu |
How can I accomplish this using a Transform Map?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 04:34 AM
Hi,
Did you tried using Transform Scripts? You can play with Source data using Transform scripts
Thank you
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 05:28 AM
Should the Transform Script be onBefore, onAfter, onComplete?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 04:59 AM
Hello,
Please use this script and test it,its untested.
var concatString ='' ;
// Initialise GlideRecord and get the results
var gr = new GlideRecord('sourcetable');
gr.query();
while(gr.next()) {
concatString+=','+gr.field2;
}
concatString = gr.field1 + concatString;
Please mark my response as Helpful/Correct if applicable.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2022 05:30 AM
The field1 should be like an ID, for example there's 2 rows that are the same record but contains different field2 information. How can I join multiple rows related to the same record but combining the field2 information?