API: send uploaded csv file to my code on other server?

Hi there. I want to use Bubble mainly for as much UI as possible. However, I think some things are very hard to do, so I was thinking of doing these options:

  • is there a way I can use the file uploader UI in Bubble to send the file (most likely CSV) to my code elsewhere? API connector to an API I write?

  • alternatively, I can write my own upload UI and process the file, but how do I link this UI and backend processing to my Bubble app (which would contain the rest of my app)?

  • is there a third option of upload from Bubble to S3, somehow trigger my API to take that file from S3 to do the next step and pass back information to my Bubble app?

I don’t really want to write everything outside Bubble. I want to figure out how to use as much Bubble as possible since it’s easy and time-saving! If there’s some way I can mix and match Bubble UI with limited UI I have to write on my own, that’d be ideal.

Thanks!

If anyone has an answer to this would be interested in learning more!

Hi @nitin.iyer.1103 ,

If you’re doing the same thing that @linfu was trying to do, I’d recommend using AWS Lambda and API Gateway. You can do roughly the following:

  • (create an AWS account)
  • Create a Lambda function to handle your processing
  • Create an API with API gateway, and connect it to your lambda function.
  • Connect API connector in Bubble to your API
  • Pass data to your API in a workflow that calls API connector.
  • If your processing will take longer than 30 seconds, you could set up a web-hook: an API workflow in Bubble that can receive messages from other applications. You can then get your lambda function to call that API workflow. Another option is to use the Bubble data API, if you just want to write data to your database.

In short, you write a processing script (in python, javascript, or w/e), and expose it via an API that you connect to via Bubble’s API connector. We have several tutorials on doing exactly this. You can check out the video below, for example. The use case is processing images, but the principles are the same. Happy to help if you get stuck. Good luck!

1 Like

Awesome! Was considering doing this with Google Cloud Functions. One follow-up question is how do I pass the uploaded CSV through the API connector? Was reading elsewhere that only JSON body types are supported? Thank you!

Mm, GCF would work too, same idea.

I think I’d pass the file as base64 (i.e., as a file), rather than trying to pass JSON.

Got it, thank you!