Back to start

Flowweaver examples · For whoever integrates

Add a code list of your own

Nothing is bundled: a list is something you add. This page fetches exempel-arendetyper.json, registers it, and the guide below uses it. Four lines, and they are printed in full further down.

Registering the list…

The code

import { registerCodeList } from "@johanfuruskog-create/flowweaver-viewer";

const answer = await fetch("/my-lists/case-types.json");
registerCodeList(await answer.json());

Then in the editor: select the lookup question, choose Source: bundled code list and your list under Code list. The picker reads the registry, so the list appears by itself — but register before the editor renders.

The file

{
  "id": "exempel-arendetyper",
  "standard": "custom",
  "items": [
    { "value": "BYGG", "label": { "sv": "Bygglov", "en": "Building permit" },
      "synonyms": [{ "sv": "tillbyggnad" }, { "sv": "nybyggnad" }] },
    { "value": "ANMAL", "label": { "sv": "Anmälan utan lov" },
      "synonyms": [{ "sv": "attefall" }] }
  ]
}

Only id, standard and items are required, and each entry needs a value and a label in at least one language. version and source are for copies of somebody else's list — your own list of your own case types has no such source.

Synonyms are not decoration. The list says Notification without permit and everybody says attefall. A field that cannot find what people type reads as broken, not as strict. Try it in the guide above.

A malformed list is refused by name rather than registered in silence: "x" post 0 (A) har ingen etikett på något språk. The quiet alternative would be a field that finds nothing, which looks exactly like a search that found nothing.

The whole list: exempel-arendetyper.json. The ones that ship with the product sit beside it — countries, municipalities and counties.

Why Flowweaver exists