Skip to main content

Hi All!

I am importing a paragraph of items and quantities (Separated by Commas) and need quantities and items usable individually to export to my CRM

The output I have currently looks like this: 

1 x Extended Warranty, 12 x Solar Panels, 3 x Hwt, 7 x Switches

 

I have tried Formatter - Split Text (As Line Item using comma as the separator but thats only getting me line items showing “1 x Etended Warranty” and I need the quantity to be separate also???

Any help would be awesome!

Hi @JimmyDawg 

Good question.

Try this JavaScript Code step...

 

CONFIG

 

CODE

let Items = inputData.Items.split(",");
let Qty = ];
let Name = ];

for (let i = 0; i < Items.length; i++) {
Itemsei] = Itemsei].split(" x ");
QtyQi] = Itemsei][0];
Nameai] = Itemsei][1];
}

output = {Items, Qty, Name}];

 

RESULTS

 


Awesome, thanks for sharing this @Troy Tessalone!

@JimmyDawg, do you think implementing this would work for you? Keep us posted! 🤗