Hello,
I’m currently trying to create my first project with bubble.
I’m trying to acchieve copying a songlist by the Spotify API to my Bubble Database. I need this to let other users access the playlist items of one user and let them vote for the best song, to create something like a jukebox.
I tried multiple ways, e.g. with Scheduled API Workflows on a List. Which works but takes ages.
Now I’m trying to do it with bulk adding things via API. I used the API Connector plugin and created the post call to “https://[appname].bubbleapps.io/version-test/api/1.1/obj/[table]/bulk”.
Now I try to add multiple items at once, which is possible when I type in a manual body like this:
{“name”: “name 001!”}
{“name”: “name 002!”}
But I need dynamic values with unclear row count for this body. The body must be created based on the results of the API call to Spotify: “https://api.spotify.com/v1/playlists/[playlist_id]/tracks”. With x entries.
What I tried now is to create my own plugin which gets the result of the Spotify call as a list and returns a simple string that I can use as the body value within a the workflow API call to Bubble.
Then I use this string value of the plugin in my workflow:
When I now return from my created plugin a string: {“name”: “name 001!”} it works just fine.
When I try to return a string with linebreaks it doesn’t work anymore:
return ‘{“name”: “name 001!”}\n{“name”: “name 002!”}’
When you check it in debugger everything looks fine as it should work but it doesn’t create anything in the corresponding table. And I had a working version yesterday but then I started to create the whole thing with real values and somehow it doesn’t work anymore and I tried so many things to get it working again with this simple return value without success.
Now I hope anyone has an idea. Is this a bug or do I miss something. As said, it worked yesterday after many many tries but then it stopped working again and I can’t find anything else I can try.
Hope for some good feedback, thanks in advance.