Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Cannot create table

Topic Labels: Custom Extensions
Solved
Jump to Solution
1957 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Widgetic
6 - Interface Innovator
6 - Interface Innovator

Hi all!

I’m trying to create a new table using base.unstable_createTableAsync following the example in the guide. This is the code I’m using -

const fields = [{ name: "MyField", field: FieldType.SINGLE_LINE_TEXT }];
if (base.unstable_hasPermissionToCreateTable("MyTable", fields)) {
   await base.unstable_createTableAsync("MyTable", fields);
   // and create records
 }

But I keep getting the error

Uncaught (in promise) Error: Can't create table: invalid field config for field 'MyField'.
Creating or updating options for undefined fields is not supported at this time.
    at Mutations._assertMutationIsValid (bundle.js:formatted:7299)
    at Mutations.applyMutationAsync$ (bundle.js:formatted:6813)
    at tryCatch (bundle.js:formatted:94903)
    at Generator.invoke [as _invoke] (bundle.js:formatted:95131)
    at Generator.prototype.<computed> [as next] (bundle.js:formatted:94956)
    at tryCatch (bundle.js:formatted:94903)
    at invoke (bundle.js:formatted:94997)
    at bundle.js:formatted:95030
    at new Promise (<anonymous>)
    at callInvokeWithMethodAndArg (bundle.js:formatted:95029)

What am I doing wrong? Thanks in advance!!

1 Solution

Accepted Solutions
Kamille_Parks
16 - Uranus
16 - Uranus

You need to change field: to type:

See Solution in Thread

2 Replies 2
Kamille_Parks
16 - Uranus
16 - Uranus

You need to change field: to type:

Will try, thanks so much!