Hello engineers, I have an airtable node with a field of type select. However when I pass data through this field yet it was not in the options field in, the value cannot be added in Airtable options.
What is the error message (if any)?
ERROR: Invalid input for 'status' [item 0]
'status' expects one of the following values: [Open, In Progress, In Review, Completed] but we got 'Type Cast Trial'
Note
I have enabled Typecast in my airtable node
Below is a screenshot of the node and the error
That looks like Airtable is saying the status field can only contain one of the following values.
Open
In Progress
In Review
Completed
But the node is sending Type Cast Trial it sounds like it might just need to be updated in Airtable or there might be a delay between adding the option and it being available to the API.
To fix this on my workflow, I downloaded the workflow json, change the line related to my Select field from options to string and it works: "type": "options", -> "type": "string",
I don’t know if my workaround makes sense? Maybe n8n has another way to do this?
The option doesn’t exist in Airtable at first, the use case is I want n8n to create a record with a brand new option.
Changing Options > String does the trick, but I don’t know if there is another workaround.
It looks like this continues to be a bug. The issue is not on the Airtable side (it never gets there), but in the n8n validation of the new option.
The typecast option should allow you to add a new option to a select field at the same time as you create/update a record. If the available options for a select field are:
Creating/update a record with typecast: true should allow you to create a new record with Animal = Moose. The issue is that n8n does not think that is a valid option, getting the error:
'Animal' expects one of the following values: [Dog, Cat] but we got 'Moose'
ExpressionError: Invalid input for 'Animal' [item 0]
at validateValueAgainstSchema (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/node-execution-context/utils.js:144:15)
at ExecuteContext._getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/node-execution-context/node-execution-context.js:188:61)
I’m not sure if it’s possible in n8n to dynamically add the new option before validation. But it seems like a few potential solutions:
Dynamically add the new option as a valid option when typecast=true
Ignore option validation when typecast=true
Do a separate call to add the select option to the field.
The reason changing the type to string works is because it skips this validation.
Hi all, jhand is correct and this is a bug with n8n. The native Airtable integrations is a mess and I recommend keeping things simple and not using it.