These docs are for v3.2. Click to read the latest docs for v5.0.

Discussions

Ask a Question
Back to All

Can't save additionalData with default value

Hello,

I've got some additionalData set up in my manifest.json like so:

    "additionalData": {
        "Categories": {
            "title": "Categories",
            "storageKey": "Categories",
            "modelKey": "Categories"
        }
    }

In my schema.json and options.json, I have:

    "Categories": {
      "type": "string",
      "required": true,
      "title": "Category"
    },
        "Categories": {
            "title": "Category",
            "type": "select2",
            "dataService": {
                "action": "LookupData",
                "data": {
                    "dataKey": "Categories",
                    "valueField": "Id",
                    "textField": "Title"
                }
            }
        },

It all works fine except when I add new content. The Select2 dropdown defaults to the first option - but when I click Save I get this error:

This field should have one of the values in Core, Bespoke, Business Bureau. Current value is: 4a45f88f-ceeb-411e-be03-d5ba5717c746 

As a workaround, I can switch to another category from the drop-down, and then switch back to the first. Then it works.

Is this a bug, or have I set up OpenContent incorrectly?