I have an FTP connection that I would like to modify. The current sheet has 3 columns consisting of the SKU, warehouse number, and inventory level. Sadly the data is returned such as:
0010041
002
0000032
0010041
003
0000044
0010041
004
0000072
0010041
005
0000035
0010041
006
0000008
0010041
007
0000056
0010041
008
0000031
0010041
009
0000036
Is there a way to modify it to group by SKU and return the data back as:
@joseph910 you would need grouping on your export to group by the sku and then a transform script to flatten out your structure. You can use Celigo AI to build the script out for you.
/* * transformFunction stub: * * The name of the function can be changed to anything you like. * * The function will be passed one 'options' argument that has the following fields: * 'record' - object {} or array [] depending on the data source. * 'settings' - all custom settings in scope for the transform currently running. * The function needs to return the transformed record. * Throwing an exception will return an error for the record. */ function transform(options) { const transformedRecord = {}; options.record.forEach((item) => { transformedRecord.sku = item.Column0; transformedRecord[`division${item.Column1}`] = item.Column2; }); return transformedRecord; }