On the Import Line Items workflow, I made some good headway last night.
- I re-inserted the old Amazon
items
&refunds
importers into the engine. (It took longer than expected on account of changes to the engine in the intervening months that made the old rules not work out of the box.) - Per @charlotte’s suggestion, I preserved the Amazon Privacy Central import rules but added some code so that the instructions for those reports are hidden in the sidebar (to avoid confusion).
- I fixed some bad behavior in the sidebar import-filter dropdown when there is only a single filter option.
- I fixed a button rendering issue in Safari that caused the buttons to be one pixel tall.
These changes are all published.
BUT… I’m stuck on an issue with the CSV parser choking on some records. My YTD Amazon import has 205 line items, but, even in a fresh sheet, only 108 transactions are available. I’m pretty sure this is because of parsing issues that confuse the Utilities.parseCsv()
call.
In my Amazon CSV, I’m seeing that double quotes are applied inconsistently to text strings (e.g. product title). Sometimes they are there, other times, the Amazon CSV generator appears to rely on just the comma delimiters to define the extent of the text fields.
For example:
11/28/20,113-5216480-4204216,Caste (Oprah's Book Club): The Origins of Our Discontents,ABIS_BOOK,...
10/22/20,111-8348886-8107463,"Philips Sonicare HX9690/05 ExpertClean 7500 Bluetooth Rechargeable Electric Toothbrush, Black",HEADPHONES,...
(Yes… we own a Bluetooth toothbrush )
The CSV generator appears to base this decision on whether there is a comma in the field… but strangely the ASIN/ISBN
field is always in quotes and never has a comma in it.
I think what is causing the parser to choke (and thereby lose records) are stray single quote characters (e.g. in the Title
field) that are not wrapped in quotes (e.g. Oprah's Book Club
).
If this is indeed the cause… and we are clever, we may be able to target (and replace) these characters with a regular expression before they are processed by Utilities.parseCsv()
.
Is anyone else seeing this behavior?
Any better suggestions?
I think we are close but not quite there yet.
Thanks,
Randy