Jun 03, 2022 10:23 PM
Hi, I’m writing a program in Node.js using AIrtable API that fetches the record from Airtable and sends it to WhatsApp. The problem I’m facing is that for example, there are three columns
I’m trying to achieve that if any of the columns are empty, it skips that one and moves on to the another.
But when I execute col1 == null || col1 == undefined
it returns false
. This statement returns true only for the last column.
Also when I execute col1.length
it returns 1 but for the last column, it returns Cannot read properties of undefined (reading 'length')
I don’t understand why the empty cells/ column before the last one doesn’t return undefined.
Jun 04, 2022 05:20 PM
What is the field type of each column?
Can you see the actual value of the field?
Is it possible that the field looks empty but actually has a value?
For example, could the field have a single space character?
Jun 04, 2022 08:02 PM
All the fields have long text as their type and no I checked all the fields are same as the last one.
But only the last one returns undefined rest of them returns length as 1.
Jun 04, 2022 08:58 PM
Are any of them lookup fields?
Do any of them have rich text formatting turned on?
Jun 05, 2022 06:45 AM
No to both questions
Jun 05, 2022 10:27 AM
What are the actual values? Have you used console.log
to see their values?
If you use scripting from within the base, what are the actual values?
Jun 05, 2022 10:40 AM
Yes I have
Col 1 and Col2 log return a blank and length 1
Col 3 returns undefined.
Jun 05, 2022 01:29 PM
What do you mean by “a blank”? What is the data type? (Blank is not a data type.) Is it a blank string? Is it an array? Is it a string with a single white space character, such as a space, a tab, or a new line?
Jun 05, 2022 08:58 PM
Jun 06, 2022 07:15 AM
It really looks like the value is a text string with a single space character.