Return data from an external database in a form

Hello everyone,
In my registration form, I’d like a dropdown list field to return the list of training sessions that are present in a baserow table. I’ve configured a baserow getmany node with a filter to retrieve my future sessions.
I’m unable to display the list of sessions in the following form.
Thank you for your help.
Sincerely,

My workflow beginning

`{
  "nodes": [
    {
      "parameters": {
        "formTitle": "Formation 1er secours canin et félin - Formulaire d'inscription",
        "formDescription": "En remplissant ce formulaire, vous serez pré-inscrit à notre formation sur la session choisie.\n\nLa validation définitive de votre inscription sera effective après paiement des frais d'inscription et de la signature du contrat de formation.\n\nEn suivant, les différentes étapes, vous nous permettrez d'établir votre contrat et votre facture.\n\nPour tous renseignements, vous pouvez nous joindre par mail à [email protected] ou par téléphone au 06 23 89 64 16.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Je suis un :",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Particulier"
                  },
                  {
                    "option": "Professionnel"
                  },
                  {
                    "option": "Association"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Votre mail de contact",
              "fieldType": "email",
              "requiredField": true
            },
            {
              "fieldLabel": "Comment nous avez vous connu ?",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Réseaux Sociaux"
                  },
                  {
                    "option": "Internet"
                  },
                  {
                    "option": "Mail"
                  },
                  {
                    "option": "Bouche à oreille"
                  },
                  {
                    "option": "Réseaux professionnels"
                  },
                  {
                    "option": "OPCO/FAF"
                  },
                  {
                    "option": "France Travail"
                  },
                  {
                    "option": "Autre"
                  }
                ]
              },
              "multiselect": true,
              "requiredField": true
            },
            {
              "fieldLabel": "Moyen de connaissance - Si autre, précisez",
              "fieldType": "textarea"
            },
            {
              "fieldLabel": "Choisissez votre formation",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Premiers Secours Canin et Félin - Cursus Initial"
                  },
                  {
                    "option": "Premiers Secours Canin et Félin - Recyclage"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "responseMode": "lastNode",
        "options": {
          "appendAttribution": false,
          "buttonLabel": "Étape suivante",
          "ignoreBots": true
        }
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -208,
        256
      ],
      "id": "73f9117c-1f00-4d85-af90-036b95d7d089",
      "name": "Etape 1",
      "webhookId": "69937e1e-bfe5-40ca-b42c-0af5dd5f48ad"
    },
    {
      "parameters": {
        "databaseId": 271732,
        "tableId": 636821,
        "additionalOptions": {
          "filters": {
            "fields": [
              {
                "field": 5196662,
                "operator": "contains",
                "value": "1_Programmée"
              }
            ]
          }
        }
      },
      "type": "n8n-nodes-base.baserow",
      "typeVersion": 1,
      "position": [
        0,
        256
      ],
      "id": "a08c6561-9931-40e5-b60a-df5138b0408f",
      "name": "Récup liste session",
      "credentials": {
        "baserowApi": {
          "id": "4z3bWOvM300FWt3x",
          "name": "Baserow account"
        }
      }
    },
    {
      "parameters": {
        "formFields": {
          "values": [
            {
              "fieldLabel": "Choisissez votre session",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "={{ $json.Sessions_Nom }}"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.form",
      "typeVersion": 1,
      "position": [
        224,
        256
      ],
      "id": "858383c1-0702-4840-bda5-63130c209e14",
      "name": "Form",
      "webhookId": "d9b99d24-61a4-4950-a103-d6fd2c32a11a"
    }
  ],
  "connections": {
    "Etape 1": {
      "main": [
        [
          {
            "node": "Récup liste session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Récup liste session": {
      "main": [
        [
          {
            "node": "Form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form": {
      "main": [
        []
      ]
    }
  },
  "pinData": {
    "Etape 1": [
      {
        "Je suis un :": "Particulier",
        "Votre mail de contact": "[email protected]",
        "Comment nous avez vous connu ?": [
          "Réseaux professionnels"
        ],
        "Moyen de connaissance - Si autre, précisez": "",
        "Choisissez votre formation": "Premiers Secours Canin et Félin - Cursus Initial",
        "submittedAt": "2025-08-26T19:11:54.279+02:00",
        "formMode": "test"
      }
    ],
    "Récup liste session": [
      {
        "id": 7,
        "order": "7.00000000000000000000",
        "Id_Sessions": [
          {
            "id": 1,
            "value": "PSCF-Ini-2025-0007"
          }
        ],
        "Id_Formation": [
          {
            "id": 1,
            "value": "PSCF-Ini",
            "order": "1.00000000000000000000"
          }
        ],
        "Sessions_Nom": "Premiers Secours Canin et Félin – Cursus Initial – Session 2025-05 – Bordeaux",
        "Sessions_Statut": {
          "id": 3881365,
          "value": "1_Programmée",
          "color": "darker-blue"
        },
        "Sessions_Date début": "2025-10-04",
        "Sessions_Date fin": "2025-10-05",
        "Sessions_Date fin signature": "2025-09-20",
        "Année": "2025",
        "Sessions_Id-Lieu": [
          {
            "id": 5,
            "value": "Lieux-005",
            "order": "5.00000000000000000000"
          }
        ],
        "Sessions_Id Formateurs": [
          {
            "id": 1,
            "value": "Formateurs-001",
            "order": "1.00000000000000000000"
          },
          {
            "id": 2,
            "value": "Formateurs-002",
            "order": "2.00000000000000000000"
          }
        ],
        "Sessions_Nb apprenant max": "10",
        "Contrat": [],
        "Contrat - Id_Sessions report": [],
        "Apprenants": [],
        "Chiens": []
      },
      {
        "id": 8,
        "order": "8.00000000000000000000",
        "Id_Sessions": [
          {
            "id": 1,
            "value": "PSCF-Ini-2025-0008"
          }
        ],
        "Id_Formation": [
          {
            "id": 1,
            "value": "PSCF-Ini",
            "order": "1.00000000000000000000"
          }
        ],
        "Sessions_Nom": "Premiers Secours Canin et Félin – Cursus Initial – Session 2025-06 – Angoulême",
        "Sessions_Statut": {
          "id": 3881365,
          "value": "1_Programmée",
          "color": "darker-blue"
        },
        "Sessions_Date début": "2025-11-29",
        "Sessions_Date fin": "2025-11-30",
        "Sessions_Date fin signature": "2025-11-15",
        "Année": "2025",
        "Sessions_Id-Lieu": [
          {
            "id": 1,
            "value": "Lieux-001",
            "order": "1.00000000000000000000"
          }
        ],
        "Sessions_Id Formateurs": [
          {
            "id": 1,
            "value": "Formateurs-001",
            "order": "1.00000000000000000000"
          },
          {
            "id": 2,
            "value": "Formateurs-002",
            "order": "2.00000000000000000000"
          }
        ],
        "Sessions_Nb apprenant max": "10",
        "Contrat": [],
        "Contrat - Id_Sessions report": [],
        "Apprenants": [],
        "Chiens": []
      }
    ]
  },
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "b0b0cc28823bad9ace62e0720bcf1a8c0a5d76cb37c454ca55f0660d28b0d7ed"
  }
}`

The output returned by the last node

I can’t take a screenshot but I only get part of my list (actually one value)

Information on your n8n setup

  • **n8n version : 1.106.3
  • **Database (default: SQLite): sqlite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app) : docker on vpn
  • Operating system:

The reason you only see one session in your dropdown is because in your Form node you have:

“values”: [
{
“option”: “={{ $json.Sessions_Nom }}”
}
]

That only maps one record at a time (the current item).

Before the Form node, insert a Set node (or Function node) to aggregate all session names into an array of options:

**Function node example:
**
return [
{
json: {
options: $items(“Récup liste session”).map(item => ({
option: item.json.Sessions_Nom
}))
}
}
];

Then in your Form node → fieldOptions.values → set:

={{ $json.options }}

This way, your dropdown will show all sessions from Baserow, not just one.

Thank you for your quick response.

I correctly added the function node. It returns:
[ { "options": [ { "option1": "PSCF-Ini-2025-0007", "option2": "Premiers Secours Canin et Félin – Cursus Initial – Session 2025-05 – Bordeaux" }, { "option1": "PSCF-Ini-2025-0008", "option2": "Premiers Secours Canin et Félin – Cursus Initial – Session 2025-06 – Angoulême" } ] } ]

And in the form, it still only gives me one line with [object Object],[object Object]

I’m restoring the current flow :

Thanks again

You cant just build the options for the one field. You’ll need to build the json for the entire form using the json option.

You’ll need to just map your values from your lookups to use the above format for the dropdown values

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