Forum Academy Marketplace Showcase Pricing Features

Upload JSON to bubble DB

Hello everyone!

I’m configuring an external API for file uploads, and i need to send a form-data request with a json file with metadata and the picture file next.
For this, i would need to store somehow a .json file somewhere (since i can´t send json as a string, it must be a file).
Is there any way to generate a JSON and upload it to bubble database, so i can use it in the workflow when calling the API?

My WF would be:

User uploads image > User trigger the upload > A JSON is generated with the metadata and uploaded to Bubble > request is sent with //aws json file from previous step and pictureUploader value (also as //aws file)

I think that server actions plugin could work here, but can’t figure how :dizzy_face:
@mishav

Thank you in advance!

If you store the JSON into a file, create an API Connector GET request to the file url. You can use [fileurl] to be able to dynamically provide a different url each time. If the JSON is always have always the same structure, it will work fine.

Another option is to use JSON plugin. Use API connector to read the file as text instead of JSON, and provide the test to the JSON plugin

Hi Jici!

The thing is that the json needs to have different data eaac time (but same structure), that’s why i want to create and upload it each time to bubble.
Maybe its more clear with this screenshot, i need to upload the .json file for ‘request’ key, i can’t send it as a JSON string because the API returns an error, it must be a file

which plugin?

Sorry, I didn’t understand your request correctly. I was thinking you need to read a JSON file, not to write one, upload it to Bubble and send it with API Connector.

I think that using Plugin with server script may be a good idea. Not sure there a plugin (or maybe more than one) that can do what you need.

1 Like

Yeah, i also think it may be a server script :thinking:, i’ll keep looking for something!