Forum Academy Marketplace Showcase Pricing Features

Can you store information from an API in your app's database?

Hi guys, I’m using the Spotify Complete App (it uses the Spotify API) in my app. It allows me to retrieve the tracks an user has liked, and I was wondering if it was possible to store this information in the Bubble’s database in order to organize it (sort it, tag it, save it etc.).

The challenge that I see is that the tracks and the tags are specific to each user, so that might be a problem…

Here’s what I’ve tried to do so far :

To be able to store properly the result of your call in your database you’ll need to set the right type of things retuned by your call.
I don’t know about Spotify but sometimes there are some extra fields to send when you make a call to filter or sort what’s retuned. This way you’ll get the data the way you like right away.

2 Likes

Thanks for the answer !
Should I set it in the database or should it be a workflow ?

Two options.

  • Pull out the relevant fields and store them
  • in your database, have the field type set to the structure of the API returned when you initialised. Then you have everything.
1 Like

Hmm, I’m not sure I know how to do this, is this what you mean by “in your database, have the field type set to the structure of the API returned when you initialised. Then you have everything.” ?

bubble

You can set your playlist field to the result of the “get user playlist” API call.

Then you can drill down into the structure if you need.

To store some data from your API call you can watch this video: data type returned by the API

1 Like

Yep, this is what I wanted to do ! Thanks again !

2 Likes