Skip to content

Taxonomies, references and bylines

Assign categories and tags by name, link entries to other entries, and credit existing bylines. Every lookup runs before the write, so a dry run reports the same misses a real run would hit.

EmDash keeps terms, references and byline credits outside an entry’s own fields. Flux Importer looks each one up from a value in your record, then writes the links with the entry, in the same write.

  • Taxonomy terms (categories, tags or any taxonomy on your site) are found by slug or by label. Missing terms can be created.
  • Reference fields link to entries in another collection, found by entry ID, slug or import key.
  • Bylines credit existing bylines, found by slug or by name. Bylines are never created.

A mapped taxonomy, reference field or bylines list replaces what the entry had, the same way a mapped field replaces its value. An empty value removes every term of that taxonomy, or every reference or byline, from the entry.

In the wizard’s Map step, the field list shows the collection’s fields, then the taxonomies attached to it, tagged taxonomy, then a Bylines row. Drop a source key on one, then choose its settings in Details:

Row Settings
A taxonomy Match terms by (Slug or Label), Term separator, Path separator (hierarchical taxonomies only), Create missing terms
A reference field Match by (Entry ID, Slug or Import key), Separator
Bylines Match bylines by (Slug or Name), Separator

One source value can hold several items: News, Phones is two terms with the default separator, a comma. A JSON or XML array works too, one item per element.

Mapping suggestions never fill these rows; map them yourself. See AI mapping.

Given this CSV:

sku,title,categories,tags
MUG-01,Blue mug,Kitchen/Mugs,blue|ceramic
MUG-02,Red mug,Kitchen/Mugs,red|ceramic

this template assigns a category by its path of labels, and tags by slug:

{
"version": 1,
"collection": "products",
"locale": "en",
"key": { "from": "sku" },
"fields": {
"title": { "from": "title", "type": "text" }
},
"taxonomies": {
"category": { "from": "categories", "match": "label", "create": true },
"tag": { "from": "tags", "separator": "|" }
}
}
  • By slug (the default), each item must equal a term’s slug exactly.
  • By label, an exact label match wins. Otherwise a case-insensitive match is used, but only when exactly one term matches. Two sibling terms that both match fail the record with ambiguous_term.
  • Hierarchical taxonomies split each item on the path separator (default /) into a path from a top-level term: Kitchen/Mugs is the term Mugs under Kitchen. A path has at most 10 levels. A single segment by slug finds a term at any depth, because slugs are unique in a taxonomy. When the slug exists under another parent, the record fails with term_path_mismatch.
  • Flat taxonomies never split on the path separator, so a tag such as AC/DC stays one term.
  • The term separator must differ from the path separator.

Terms are looked up in the template’s locale only. A term that exists only in another locale isn’t found.

With Create missing terms on ("create": true), a real run creates each missing term, and its missing parents, in the template’s locale. This uses the plugin’s taxonomies:write capability. See Permissions.

  • Matching by label, the new term gets the segment as its label, and EmDash generates its slug.
  • Matching by slug, the segment becomes both the slug and the label. It must already be a valid slug (lowercase letters, digits and hyphens); if not, the record fails with invalid_term_slug. Match by label instead.
  • A dry run creates nothing. It plans the assignment and lists the terms it would create in the record’s log (newTerms).
  • A rollback keeps the terms an import created. EmDash gives plugins no way to delete terms. The rollback restores each entry’s old assignments and warns how many created terms it kept. See Rollback.

With creation off, a missing term fails the record with term_not_found.

  • At most 20 taxonomies per template, and at most 100 terms per taxonomy per record.
  • Each path segment is 1 to 200 characters. An empty segment, as in Kitchen//Mugs, fails with invalid_term_path.
  • The taxonomy must exist and be attached to the template’s collection. If not, job creation refuses the template.

A reference field links an entry to entries in another collection. Flux Importer looks up each target and sends EmDash its entry ID.

Match by Template value Finds
Entry ID "id" (default) The entry with that ID in the target collection, in any locale.
Slug "slug" The entry with that slug in the target collection, in the template’s locale.
Import key "key" The entry a Flux Importer import created from a record with that key, in the template’s locale.

Import key is the one to use when both collections come from the same feed or system: import the authors first, then point the books’ author field at the author’s key.

"fields": {
"author": { "from": "author_id", "type": "reference", "match": "key" },
"related": { "from": "related", "type": "reference", "match": "slug", "separator": "|" }
}

A missing target fails the record with reference_not_found.

  • The field must be bound to a relation, as every reference field EmDash creates is. A legacy field without a relation is refused; bind it first, as EmDash’s relations guide explains.
  • At most 50 targets per field per record, and at most 1 when the field takes a single entry. Each value is 1 to 200 characters (256 for an import key).
  • Import key needs entries imported into the target collection. A template that matches by import key into a collection Flux Importer never imported into is refused, unless the target is the template’s own collection.
  • Import the targets first. Records aren’t reordered. A reference by import key to an entry the same import hasn’t written yet fails with reference_not_found. Once the target exists, choose Retry failed records on the Run step, or run the import again.
  • In a dry run, a reference by import key to an entry an earlier record of the same dry run would create, in the same collection, counts as found. A reference by ID or slug to such an entry can’t be foreseen, so the dry run reports reference_not_found while the real run finds it.

On a collection with revisions, references are staged with the draft, like field values.

Bylines credit people on an entry, in order. Flux Importer only credits bylines that already exist; it never creates one.

"bylines": { "from": "authors", "match": "name", "separator": ";" }
  • By slug (the default), each item must equal a byline’s slug.
  • By name, each item must equal a byline’s display name, after trimming, with the same case. Two bylines with the same name fail the record with ambiguous_byline.
  • The byline must exist in the template’s locale, or the record fails with byline_not_found.
  • At most 50 bylines per record.
  • A byline the entry already credits keeps its role label. New credits have none.

Each batch loads up to 5,000 bylines for its lookups. On a site with more, a byline outside that set fails with byline_lookup_limit.

  • Terms and bylines go live at once. On a collection with revisions, EmDash writes terms and bylines to the live entry immediately, even when the field values wait in a draft or the import doesn’t publish. This is EmDash’s behaviour.
  • Re-runs stay unchanged. The comparison reads back what EmDash stored, so a second run of the same data plans unchanged.
  • Translations share terms and references. EmDash keeps them per translation group, so a record that translates another entry skips its taxonomy and reference mappings. See Translations.
  • Workers run smaller batches. On Cloudflare Workers a template that maps taxonomies, references, bylines, translations or media imports at most 6 records per batch in the wizard (11 otherwise), because each record makes more queries. A scheduled run’s batch is smaller still: 3 records (6 otherwise). See Schedules.

Every error code above is a record outcome: the record fails without a write and the rest of the import goes on. See Job states and record outcomes.