I am trying a little bit complex multiple page form. So in first step user fills out data needed and then gets sent to according form depending how many travelers are applying for travel. This is the first part I am struggling. Is it possible to create it in some other ways? Making 5 different forms for such a small task seems too much.
Then after traveler data is filled, user must choose what he needs (Flight, Hotel, Car or Ferry) it can be one of them or even all of them. (Unable to post full code because of limit) So depending on what is chosen the user should be directed to each form subsequently, I cannot make it so. I tried almost everything I presume, would appreciate any help. Also is it possible to somehow populate the dropdown list without creating webhook etc for each branch?
Just to clarify if user selects Hotel → Hotel form
If user selects Hotel and Flight → Hotel form → Flight form
Etc.
Information on your n8n setup
n8n version: 1.76.1
Database (default: SQLite): SQLite
n8n EXECUTIONS_PROCESS setting (default: own, main): own
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
Thank you for your reply, I looked at your solution but I am unable to create those forms anyway. I managed to get the last part of workflow to work accordingly (one by one if chosen) by changing workflow execution order to v0 (legacy). Could you please give an example of dynamically generated forms?
Based on your original workflow, after the initial form I have added a code node. This node uses the number of travelers field and generates JSON to create name and email fields for each traveler, including appropriate labels.
For the second form node, now called “Dynamic travelers”, we change the “Define Form” parameter and set it to “Using JSON”.
For the Form Fields we set this to an expression and use {{ $json.formFields }} which is the value calculated in the previous code node.