Multiple options in resource mapper

Describe the problem/error/question

I am trying to implement multiple options in resource mapper. My goal is creating an input that accept multiple values from the dropdown. But it only accept one options after picking the option.

Can anyone give me advises? Thank in advanced

It look like that:

I expect this:

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
{
  "meta": {
    "instanceId": "b86dde216c5b97104718a3c7ba5a1520cb74198d77e892f578e530926354a0fb"
  },
  "nodes": [
    {
      "parameters": {},
      "id": "8e49c44a-6bf5-4d1b-8722-e7baa0bdf88b",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "table": {
          "__rl": true,
          "value": "sample_table",
          "mode": "list",
          "cachedResultName": "sample_table"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "name": "hello this is test",
            "status": "inactive",
            "tags": "['inactive']"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "name",
              "displayName": "name",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "options",
              "canBeUsedToMatch": true,
              "options": [
                {
                  "name": "pending",
                  "value": "pending"
                },
                {
                  "name": "inactive",
                  "value": "inactive"
                },
                {
                  "name": "active",
                  "value": "active"
                }
              ]
            },
            {
              "id": "tags",
              "displayName": "tags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "array",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "a3cd4299-c483-4b45-869c-9f61567619ab",
      "name": "Postgres",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.3,
      "position": [
        940,
        300
      ],
      "credentials": {
        "postgres": {
          "id": "4",
          "name": "Postgres account"
        }
      }
    }
  ],
  "connections": {
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "Postgres",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Maybe @marcus could help you out here? :slight_smile:

Hi @Stefan_Ng,
instead of using the Resource Mapper component (which doesn’t support multi select at the moment) you could use multi-options.

If you want to dynamically load data you can use the typeOptions.loadOptionsMethod. Here is an example implementation from the Affinity node:

2 Likes

@markcus. Thank for your support. I just added multiOptions into FieldType interface and some other places then deployed my own fork. It works now.

@marcus @EmeraldHerald Can I contribute to this feature? I believe there’s no reason not to support multiple options in the resource mapper.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.