Skip to content

Data Table CSV Export and Import

You can export a Data Table to a CSV file, edit it in a spreadsheet tool, then import it back into PlayMaker.

This is useful when you want to:

  • Bulk edit many rows at once
  • Review table data outside Unity
  • Share table content with designers or translators

Use the CSV buttons in the Data Table inspector:

  • Export CSV... writes the current table to a .csv file
  • Import CSV... reads a .csv file and updates the table

Basic Rules

CSV import and export uses the table's current Data Definition.

For this workflow, assume you are importing a CSV that was originally created with Export CSV....

  • Export writes the field names needed by the table
  • Import uses that exported structure to update the table
  • You can safely edit row values in the CSV before importing it back

Do not edit the CSV comments above the table

Leave the exported comment and metadata rows at the top of the CSV unchanged. Do not remove them or edit their values.

Use exported CSV files as your template

Start by exporting from PlayMaker, then edit that file instead of building a CSV from scratch.

Typical Workflow

  1. Open a DataTableAsset or DataTableComponent.
  2. Click Export CSV....
  3. Edit the CSV in your spreadsheet tool.
  4. Edit the row values you want to change.
  5. Save the file as CSV.
  6. Back in Unity, click Import CSV....

Asset vs Component

DataTableAsset and DataTableComponent both support CSV import and export, but they do not handle object references the same way.

DataTableAsset

Use a DataTableAsset when your CSV contains shared data, including prefab asset references.

  • Works well for text, numbers, booleans, enums, resource paths, and prefab asset references
  • Prefab references are exported as human-editable path values
  • Export also writes prefab GUID metadata so import can still resolve moved prefab assets

This makes DataTableAsset a good fit for tables that point at prefab roots, child GameObjects inside prefabs, or Components inside prefabs.

Examples of readable prefab values include:

  • prefab:Assets/MyPrefabs/Enemy
  • prefab:Assets/MyPrefabs/Enemy:/Weapon
  • prefab:Assets/MyPrefabs/Enemy:/Weapon@UnityEngine.Transform

Syntax breakdown:

  • prefab: means the reference points into a prefab asset
  • Assets/MyPrefabs/Enemy is the prefab asset path, without the .prefab extension
  • :/Weapon means the child GameObject named Weapon inside that prefab
  • @UnityEngine.Transform means the reference points to a specific Component on that object instead of the GameObject itself

For prefab child paths, the exported format uses :/ChildName.

DataTableComponent

Use a DataTableComponent when your CSV needs to preserve references to scene objects in the loaded scene.

In addition to normal table data, component export writes metadata that identifies the exporting component and stores scene-relative paths for:

  • GameObject references
  • Component references

Those scene references are also written in human-editable form, then resolved relative to the importing component's scene.

Examples of readable scene values include:

  • go:/Enemies/Boss
  • component:/Enemies/Boss@UnityEngine.Transform

Scene syntax breakdown:

  • go: means the value points to a scene GameObject
  • component: means the value points to a Component in the scene
  • /Enemies/Boss is the path to the GameObject in the scene hierarchy
  • @UnityEngine.Transform means the specific Component type to restore on that GameObject

The leading / in scene paths is optional when importing. PlayMaker exports scene paths with a leading slash, but import also accepts paths without it.

Those references can round-trip when:

  • the CSV is imported back into a DataTableComponent
  • the target objects are still in the loaded scene
  • the scene hierarchy still matches the exported paths

Import into the same scene context

Scene references are resolved relative to the importing DataTableComponent's scene. If you move, rename, or delete the referenced scene objects, those references may not restore.

If you import a component-exported CSV into a different DataTableComponent, PlayMaker warns that scene object references will be resolved in the importing component's scene.

Object Reference Rules

Here is the simplest way to think about it:

  • Prefab references and scene references are both exported as readable path-style values
  • Prefab references round-trip in both Assets and Components
  • Scene references round-trip reliably with Components
  • Plain values work in both
Data in CSV DataTableAsset DataTableComponent
Text, numbers, bools, enums Yes Yes
Resource paths Yes Yes
Prefab root references Yes Yes
Prefab child GameObject references Yes Yes
Prefab Component references Yes Yes
Scene GameObject references No Yes, if the same scene context is available
Scene Component references No Yes, if the same scene context is available

Tips for Reliable Imports

  • Export a sample CSV first and use it as your template
  • Do not rename columns unless you also rename the matching fields in the Data Definition
  • Keep prefab paths and scene paths aligned with the objects you want to restore
  • Re-import component CSV files with the same scene loaded
  • Use DataTableAsset for reusable project-wide data and prefab references
  • Use DataTableComponent for scene-local data and scene references

See Also