Help

Re: Records being created with incomplete information

1439 1
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

If anyone is willing to take a look at my code and see if there are any obvious errors, I’d be very grateful. I’m still becoming reacquainted with JavaScript after not touching it for many years—for example, this is my first time ever making custom classes—so it’s possible there’s something with newer JavaScript style that I’m overlooking.

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…

3 Replies 3
Shrey_Banga
6 - Interface Innovator
6 - Interface Innovator

Hey @Justin_Barrett — this looks like the same issue as Script Block - Linked Record Issue. We have a fix for that going out soon. To confirm that it’s the same issue, can you try reloading your page (hit reload / Command-R / F5) after you run the script to see if the data populates correctly? The underlying issue is that the updates go through but the linked tables don’t show the updates until they are reloaded.

That used to be the problem with my “dumb” version of the script, and it’s still an issue there (confirmed last night). With the new version, I have truly empty records.

Another issue when I tried to make the original version work for me anyway: data in certain fields disappears after refreshing the page. The refresh still fixes those “Unnamed record” links, but now I’m losing data as well.

I’m tied up with work right now, but I can break off a stripped-down version of my base and share it with you if it’ll help. This the most extensive use I’ve made of the block so far, and I need it on a very regular basis, so it’s quite frustrating that the newer version of the block is performing worse than the earlier versions.

Yeah a sample base where you can repro this would help, thanks!