This n8n template showcases a cool feature of n8n Forms where the form itself can be defined dynamically using the form fields schema.
It may be debateable how useful this template actually is since both Airtable and Baserow provide form interfaces already but still a great exercise and demonstration if ever the use-case comes around.
How it works
- A form trigger is used to dynamically select a database/table from which to build the n8n form from.
- the table's schema is imported into the workflow and using the code node, is converted into the n8n form fields schema.
- This let's us dynamically build the fields in our n8n form when we choose to define the form using the JSON option.
- Once the n8n form submits, we convert the values back into our table's API schema so that we can create a new row.
- Note any files/attachments fields are removed as they need to be handled separately.
- Files are processed separately as they may first need to be stored. Once complete, the reference is saved into the newly created row.
Check out the example Airtable here - https://airtable.com/appfP15Xd0aVZR9xV/shrGFgXLyQ4Jg58SU
How to use
- The n8n form is autogenerated which means you only need provide access to the table. Using this approach, this template can be reused for any number of Airtable and/or Baserow tables.
Requirements
- You'll need either an Airtable account or a Baserow account to use this template.
- Accessible n8n instance to your users
Customising this workflow
- Not using either Airtable or Baserow? Theoretically any datastore which provides a fields schema can be used with this template.
- If you're feeling creative, split the table into multiple forms for a better user experience.