How to import excel/csv with "File Import" widget in Foundry's Slate?

Viewed 771

Context: For a data pipeline we need to ingest excel spreadsheets directly into foundry (arriving via email). In order to avoid any manual handling error, we'd like to build a small slate app that basically just uploads an excel sheet and automatically appends it to an existing dataset (given schema, headers, etc.). Unfortunately, there is very little documentation on the "File Import" widget or the API that gets called when drag and dropping a file into a folder.

Idea: Is there a way of uploading a file with slate? Could this file then be added to a dataset, similarly as with the prompt that opens when dropping it into a folder?

1 Answers

You actually don't have to build a Slate app to do this! Datasets that are made up of underlying .csv files support new additions of files directly.

Note: All of the following screenshots are from the dataset preview page.

For example, the following dataset I created from 4 .csv files:

4 files with no schema

And I can click on the Import button in the top right to add in more files (with the same schema, or not. Depends on if you want to strictly adhere to your applied schema.

add new files

If you have already applied a schema, you can also simply Import new files on top of the dataset, but the schemas of the files must exactly match those already present, otherwise your dataset will fail when attempted to be read.

import with schema

Related