I’m having a little trouble with a script I’m using to update a date field in Airtable with data from an API. The API I’m using gives date/time info most of the time. Every once in a while it’ll output a string like “UNKNOWN,” which brings the whole thing to a grinding halt. I’d like my script to be able to skip trying to enter that in and move on to the next iteration in the loop.
I’m feeding the data it gives me to a Date() function to save it as a new variable, then I pass that variable to table.updateRecordAsync(). But when the data is a string that can’t be parsed into a date, I get an error saying that the Airtable can’t store that string into a date field. Which is totally accurate and fine, but it halts the whole script.
Is there a function/operator or something to check whether a variable/constant/piece of data is in a format that Airtable will accept for a specific kind of field? Thank you!