How to upload a file to a databricks folder via fileDropZone

I want to upload a csv file into a DataBricks folder via the fileDropZone, but seems like it's impossible to implement using built in SQL or the GUI. Do I need to use workflows in this case? Looking for a easy and simple solution!

Have you setup your databricks connection (Connect to Databricks | Retool Docs)?

Once you do that, it looks like the Databricks API has good instructions on how to POST a file with their REST API.

You wouldn't need a workflow, just trigger the REST query once you set it up, but you may want a workflow if you are going to loop through a bunch of files that you upload all at once and don't want to wait for it in the front end.

1 Like

Hi @PennyZhao! Thanks for reaching out. :slightly_smiling_face:

At a high level, @jg80 is right in the sense that you'll ultimately need to query Databricks via its REST API in order to store or retrieve files. The big caveat is that the built-in connector provided by Retool can only be used to interact with tabular data, meaning the setup will require some extra work.

On the Retool side, you would need to configure a new REST API resource that authenticates with Databricks and then write a query that specifically hits the appropriate endpoint. I wouldn't call it easy or simple, necessarily, but l'm happy to help with the setup if you want to pursue that option!

1 Like