Custom Field Types in Form Builder Plugin

default discord avatar
hyprsonic.dev
2 months ago
4

I believe I'm following the docs properly, and I'm getting this error.



Here's the field schema:


const fields: Field[] = [
  {
    type: "row",
    fields: [
      {
        name: "name",
        label: "Name (lowercase, no special characters)",
        required: true,
        type: "text",
      },
      {
        name: "label",
        type: "text",
      },
    ],
  },
  {
    type: "row",
    fields: [
      {
        name: "width",
        type: "number",
      },
      {
        name: "defaultValue",
        type: "text",
      },
    ],
  },
  {
    name: "options",
    type: "array",
    fields: [
      {
        type: "row",
        fields: [
          {
            name: "label",
            type: "text",
          },
          {
            name: "value",
            type: "text",
          },
        ],
      },
    ],
  },
];


Here's how I'm using it with the plugin



Fixed, Basically the type for multiselect should be a Block, meaning I was missing the slug proerty

  • discord user avatar
    jacobsfletch
    Payload Team
    last month

    @hyprsonic.dev Ahh yea good catch. That is a

    Partial

    type so all required fields become optional. We need to explicitly maintain the requirement of this property—I just opened up a ticket in the plugin repo to improve this

    https://github.com/payloadcms/plugin-form-builder/issues/34

    .



    Custom Field Types in Form Builder Plugin

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.