Tuesday 4 December 2012

Semi Automatic Data Entry

I had a project recently where I was asked to upload product data to an ecommerce site, but the data was extremely poor quality. Such poor quality that importing it directly would be like trying to extinguish a  massive burning pile of shit by pouring water on it - the best possible outcome would be a massive steaming pile of shit.

Fortunately none of the data sets were particularly large so I resorted to manually creating the products in the admin using the customer's spreadsheets as a reference. I looked at the data and realised that much of it could simply be copied and pasted, but that it needed sense checking and wasn't complete enough to import.
What I needed was a way of speeding up the copying and pasting of the good bits of data, I ended up using Auto hot key.

AHK is basically like VB scripting in Excel but for EVERYTHING!

It lets you send keystrokes, mouse clicks, whatever you like, and most importantly jump between any programs. So I wrote a quick script that, when pointed to the first cell in a row of data in Excel, would run along the row storing each value as a variable then alt+tab over to a browser with the website admin open. Next it clicks in the right places to open the create-new-product dialog and pastes the various values in the appropriate places ready for me to fill in the missing data and sense check the result before saving. It cut the time to create each product by over half.

Now I know this is a bit of a duct tape and cable ties approach, in an ideal world I would have sent the customer data back with *another* copy of the template file and refused to even look at it until every last value would import seamlessly. But I just wanted it done, creating the script and doing it this way took less time than I imagine it would have taken to explain the intricacies of Magento's product import functionality to a non-techy. especially as I barely understand it myself.