I have a table (Parts) with a 1:many relationship to another table (Suppliers).
I’m importing a test CSV with only a few rows and it throws an error each time - I’ve tried having the supplier column being the actual supplier name and also using the supplier ID (got that via the data explorer view).
Is it still possible to import data into Parts?
If not then I’ll build my own tool to do it via the API
Hi @samwoolertonLW we are looking into this. I will answer in a bit.
@samwoolertonLW currently UI import tool doesn’t support relations. We have that feature in to-do list and I will let you know as soon as we release it.
As for now you could convert CSV file into JSON and run import using CLI command “8base import”. Run command “8base import --help” for more info.
Please let me know if it is helps!
That’s great thanks, good to know that it’s possible!
I can run 8base export
and can import a schema with 8base import
, but how do you import only data to an existing table?
Docs are a little light on that sort of thing
Editing my original answer, as I was dead wrong. There is data only / schema only flags!
https://docs.8base.com/development-tools/cli/commands#import
import
Import 8base schema file and data to the current - or specified - workspace.
8base import OPTIONS
OPTIONS:
-f, --file Path to file with schema - type: string, required: true
--schema Import schema only - type: boolean, default: true
--data Import data only - type: boolean, default: true
-w, --workspace Specify workspace id - type: string
How do you add data to the exported schema? The exported json file has a “tables” key so I tried adding a “data” top level key too but it did nothing
So here is a link to an example import file: https://github.com/8base/app-example/blob/master/server/DEMO.json
Pay attention to the data.<tableName>
keys. The placeholder like ids (customer-id-1
, etc) will handle the relating of objects. Once created, they will have actual uuid ids.