How can users safely upload a csv in Jet Admin (Workflow)

I want to give my users to upload a pre-defined csv file with employee data into my app.

So what they should be able to do;

  1. Download an example csv file with the structure (easy).
  2. Upload their version of that csv file filled with the right data.

So far it all worked out, but now I think it should trigger a workflow.

My question is how I can open the uploaded csv file and iterate through the rows and then update the employees in the database?

Thanks for any help.

You can use the ‘File Picker’ component to upload the CSV file. You can add “File viewer” component to preview the uploaded file. Then, add a ‘Value Changes’ action to trigger the workflow. In the workflow, you can update, create, and manage records. Additionally, you can write SQL queries if needed.

Hi Alina,

All clear, but how can I open the uploaded file in the workflow and then iterate through the rows of the .csv and update each record in the collection based on a column (id) in the csv?

Thanks again for your help.

Anyone who can help with this? It’s one of the last secrets of Jet Admin that I need to unlock.
Thanks for any help.

You can upload the .csv file to one of your collections and then trigger a workflow where you can use the “Iterator.”


Here is the documentation about iterators in JetAdmin: Iterators | User Guide.

But If I upload the .csv to a collection it is already updated or?

Or do you mean I should upload it first to an intermediate collection (import_employees) and then iterate through that and update the employees table based on that data and then empty the import_employees collection again?

It would be nice if you could make a short video of how I could build this.