How-to

Add sample data to a package

Sample data is a small, realistic set of records — a few programmes, sessions, clients and engagements, linked — that a tenant gets when it installs the package. It is stored with the capability version, never in a tenant, and checked against the model before it is locked.

For: Builder, Platform administrator

Prerequisite

  • capability.write at the platform; capability.publish to publish.
  • A capability draft, and the platform entities (with their fields and relations) the rows will be.

Steps

  1. Open the capability page and scroll to Sample data — version N.
  2. Under New sample dataset, give a key (for example education-consulting-sample) and a name, and press Create dataset. It is added to the version's contents at once.
  3. Prepare a workbook: one sheet per entity, named with the entity's key or name; a key column (unique in the whole dataset); a column per field; and a link:<relation key> column per relation, holding the key of the row it links to (several separated by ;).
  4. Under Upload a workbook, choose it and press Upload and replace the rows. For one entity, a CSV file works too: choose the entity its rows are.
  5. Or add rows one by one under Add or change a row: the entity, a row key, the values, and a link to a row already in the dataset.
  6. Read What a tenant would get, then publish the version from At publish.

Result

The dataset is locked with the version, with a fingerprint of its rows, and brings the entities it holds. At install a tenant gets the rows as records marked as sample, removable; nothing is written to any tenant before then.

Keep in mind Every row is checked: the fields of its entity (own and inherited), their data types, the required ones, the entity's rules, and each link's relation and target row. A workbook with one row that does not pass changes nothing and lists every reason. A published version's sample data does not change; start a new version to change it.

Tip Reference entities hold no sample rows: their records are reference data, published from the Metadata Designer.