Form file upload workflow

Hi,

I’m working on a workflow where users can upload a spreadsheet file, and the workflow will compare the data within it to another system (pulling data via an API and the HTTP node) for Billing Reconciliation purposes.

I have the process working well, but it’s currently only able to work if the submitted file has headers in exactly the right format/spelling etc. Some of these files come from external sources and I’d really like to avoid users having to open them and change the headers each time before they can be submitted.

Can anyone think of a smart way to have a form node present the first few (say, 5) rows of data back to the user, so they can then select which column contains which data? And then rename the respective field labels for the rest of the workflow to function correctly?

Thanks!

Information on your n8n setup

  • n8n version: 1.66.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows Server 2019 Std.
1 Like

hello @REN87

Here is how you can achieve that. The workflow will check if the example contains the required fields title, amount, and price in the CSV file and advise how to remap if there is a difference (example files below). You can easily reconfigure it for excel

copy the below text to the csv file ok.csv

name,amount,price
book 1,10,40
pen 2,5,15

and the below text to the csv file err.csv

title,amount,price
book 1,10,40
pen 2,5,15
3 Likes

You’re a wizard! Thank you.

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