![Ruchika_Abbi1 Ruchika_Abbi1](https://community.airtable.com/legacyfs/online/avatars/3X/6/1/617d4b27f95fd871b50dd76396c40447c965465d.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 09, 2024 07:20 AM
I have the following script to create records in a table.
Event Name is a Single Select field. But I get an error "Error: Field "...." cannot accept the provided value."
await passTable.createRecordAsync({
"Event Name": event,
"Event Date/Time": date,
"Notes": notes,
});
}
"Event Name": [{name: event.toString()}]
and
"Event Name": [{name: event)}]
but neither of them work. Any suggestions?
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 09, 2024 07:39 AM
Single select fields expect `{name: [OPTION VALUE]}`, so try
"Event Name": {name: event.toString()}
or
"Event Name": {name: event}
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 09, 2024 07:39 AM
Single select fields expect `{name: [OPTION VALUE]}`, so try
"Event Name": {name: event.toString()}
or
"Event Name": {name: event}
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 09, 2024 01:28 PM - edited ‎Oct 09, 2024 01:32 PM
Hi,
I remember my beginner steps in Airtable JS, such explanation would be critical for me 🙂
Your answer is correct in final part, but I would better say
Single-select refuses to get {name: [OPTION VALUE]}
because it's array.
Single-select expects a single object with Name
{name: OPTION_VALUE}
The `{name: [OPTION VALUE]}`, Array of objects is the format for Multiselect, Linked field, Lookup (computed, can't write to it), multi-User. maybe something else.
I would suggest to take a look in this place for cell value problems with Create/Update fields
maybe it's difficult to understand the exact format, but it usually has good examples.
Another thing to check, chatGPT sometimes reply with a brilliant answer. And sometimes it's a nonsense formatted like brilliant answer. To fix a small part of script is easier that write new from scratch.
anyway, worth a try.
![Ruchika_Abbi1 Ruchika_Abbi1](https://community.airtable.com/legacyfs/online/avatars/3X/6/1/617d4b27f95fd871b50dd76396c40447c965465d.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 09, 2024 10:53 PM
Ah! I see what I did wrong there🙈 Thanks!
![](/skins/images/75AB00B4920FD2D67A8CABF77C9DECC4/responsive_peak/images/icon_anonymous_message.png)