Import Scripts and field order
I know that not all of you use scripts that import data from another file, so if you don’t, this is going to be useless info. But if you DO, keep reading in the spirit of “It’s less painful to learn from someone ELSE’S mistake.”
When you set up an import script, you match up the fields in the order in which they should match up for the import. The annoying part for me has always been that I couldn’t “re-order” the fields on the left side of the import screen—the ones from the “sending” database. They always seemed to be in some sort of random order, not alpha.
Today I learned that the order is not at all random. It’s specifically in the order in which the fields were originally created.
So, what happens when you DELETE a field (most painfully an early-created one) from that source database? Well, sports fans, all your import scripts that depend on that database have their import order changed. The left side of the import screen changes order, shifting up to remove the space taken by the deleted field. The RIGHT side (receiving database) fields DO NOT change, meaning that they no longer match up where they used to. An “imaginary” example would have the HorseTotal going into the Grade field. Badbadbad.
And even worseworseworse, once that original field was deleted, it doesn’t do any good to go back and put it back in. Since it’s now been the LAST created field, it’s just going to plop itself at the bottom of the import list. So the only solution is to go through every script that includes an import step and manually reorder the import order.
The better solution would have been to RENAME the no-longer-necessary field, rather than deleting it. I did not learn this by reading a book or thinking logically through this, but through bitter experience (probably the best way to remember at my age). If I had it to do over, all my unnecessary fields would have been renamed to ZZoldWhateverTheyWere so that they could be easily identified as no longer necessary, but they’d have stayed within the file. I seriously hope I remember that next time!!