Jul 03, 2020 09:40 AM
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!!
Solved! Go to Solution.
Jul 03, 2020 09:55 AM
Jul 03, 2020 09:55 AM
You need to change field:
to type:
Jul 03, 2020 10:10 AM
Will try, thanks so much!