I’ve got a script that I wrote to help with processing donation requests at my job. These requests come via FormStack, and are sent to me via email (a process out of my hands at the moment, or else I’d shoot the data straight into Airtable). I copy the data from the formatted email and paste it into a single field in an Airtable record. I can make as many records as I need for any number of incoming donation requests, then run my script to process them all, creating and linking records across different tables.
My original version is what I call the “dumb” version because it doesn’t check for possible duplicate records for organizations or contacts before making new records. I wanted to make a smarter version that would use existing records where possible, so I copied the “dumb” code to a new block and have been working on the updates for several hours today. It’s mostly working, but I’m getting some very odd results.
In my tests, I’ve got three requests to process. The new request records are all made correctly, but only one of them links properly to the organization that requested it, and it’s an existing organization. For the other two records, all fields are empty.
Looking in the
[Organizations] table, I see two new records (as expected), but only one contains data. The other has all empty fields.
Looking on the
[Contacts] table, I’ve got three new contacts as expected, but the third contact record is completely empty.
I’ve inspected the data that I’m extracting—stored in instances of custom classes—and it’s all there, so I’m baffled as to why only some of it is getting inserted into the new records.
I was about to say that I can use the “dumb” version in the meantime, but I just tested it for the first time after porting it over to the published Scripting block from the beta, and it has a completely different set of data persistence/syncing issues with the same data. Grrrr…