Scheduled Spreadsheet Data Import

Hi All,

I’m trying to create an automated process to append spreadsheets (xlsx) within a folder into an existing table in SQL server database.

For Example, in the folder currently there are three spreadsheets:

  1. 22 01 24 Budget Forecast.xlsx
  2. 22 01 31 Budget Forecast.xlsx
  3. 22 02 07 Budget Forecast.xlsx

Spreadsheet 1 and 2 are already manually uploaded into the database, however now I would like to setup a weekly schedule to upload only the latest spreadsheet (spreadsheet #3 in the example).

Hoping someone can shed a light on how to do this.

Thank you in advance.

Mario

Hi Mario and welcome to the Community!

In your example, file names start with a timestamp that can be used for sorting, so you can do the following:

  1. List files in the folder (using the “List of of files” action)
  2. Sort them (using the “Sort” action) so that the most recent one is at the top of the list
  3. Import the top file using the “Import from Excel” action in the “First value” mode.
2 Likes

Hi dgudkov,

Thank you for your assistance.
I managed to load only the latest file using your instruction!

One last question to complete my project - is there a way to append this to an existing table within a database, rather than overwriting the table?

From my understanding ‘Export to Database’ action fully overwrites the table instead of just appending.

Appreciate your help.

You’re welcome!

The “Export to database” action appends rows to the target table.

1 Like

Hi dgudkov,

Thank you for the clarification. You’re a legend!