Import Data
Last updated
Last updated
When you have a lot of external data to input at once, it might be easier to organise it in a spreadsheet or use a script. In those cases, you can import the resulting CSV or JSON directly into FrontierNav.
Before trying to import anything, use Edit Data Tables to make sure you have created all the Entity Types and Properties that you plan to import.
You might want to Save Changes in case your import doesn't go to plan or you can Rewind Changes.
CSVs are a file format that most spreadsheet software can export to so check your "Save As..." or "Export" options and choose "CSV". You MUST have column headings.
If you're using scripts, you can export to an array of JSON objects.
Often a single spreadsheet column can have multiple values. For example:
Enemy | Item Drops |
---|---|
Enemy 1 | Potion, Sword |
Enemy 2 | Potion, Antidote, Sword |
It's best to split these spreadsheet columns up before importing them. So you can have "Item Drop 1", "Item Drop 2", "Item Drop 3".
Enemy | Item Drop 1 | Item Drop 2 | Item Drop 3 |
---|---|---|---|
Enemy 1 | Potion | Sword | |
Enemy 2 | Potion | Antidote | Sword |
You can then apply multiple Relationship setters to combine them under a single Relationship property. Columns with no value will be safely ignored. If you do not want to do this manually, you can use a spreadsheet formula like SPLIT(B2, ", ")
.
To start an import:
Go to the table you want to import data to.
Click the triple dot dropdown menu on the top right and choose "Import data".
Choose a file and you will be presented with a form.
This form may look complicated at first glance. Essentially the import process will:
Go through each row of your data sequentially.
Match each row to an Entity.
Set properties on the matched Entity from the given columns.
First select the Entity Type to import into. After that, select the criteria to match an Entity to a row in your file. Finally, set the matched Entity's properties to columns in that row.
Once you are ready, press the "Import" button. Once you are happy with the import, remember to Open a change request.
If a row does not match any entity, by default it will be ignored. You can choose to create an Entity instead. However, if doing so, you need to set a unique Name property. The import will fail if there is no Name.
If you are setting Relationships to an Entity and it does not match an existing Relationship, by default it will be ignored. You can choose to create a new Relationship instead.
Unlike entities, you do not need a Name to create a Relationship, but a target Entity must match. If you want to create the target Entity too, you must match a unique Name otherwise it will be ignored.
If a row fails to import, an error will be shown and the import will immediately stop. No changes from the import will be applied.