Hi there!
I’m trying to build a kind of dashboard which displays news (three different types of news: techblogs, science publications, funding events) retrieved from an external API and refreshes them every day automatically.
Therefore, I need to store the retrieved data in the bubble-database.
The data consits of JSON-Files with several attributes and looks something like this (with more attributes):
{“TotalHits”:9048,“Documents”:[{“Title”:“Example Title”, “Date”:“2022-09-26T18:55:08.8350000Z”}, {“Title”:“Example Title2”, “Date”:“2022-08-26T18:55:08.8350000Z”}]}
For each newstype (Techblog, Science Publication, Fundings) I make a different API-Call, so I get 3 different JSON-files.
Each newstype should contain 4 articles (each JSON file should have 4 entries of type “Document”).
I’ve already tried several ways to achieve this goal, but none of them really worked.
Here is my current approach:
I created a new data type with 3 fields which match the 3 different types of news. As field type, I’ve selected the data types the API Call returns.
I initially kick off my workflow via a button in the frontend:
My triggered backend-workflow looks like this:
As a first step, I want to delete every old article from my database:
Next, I want to create a new entry with the data I get from my API:
In a last step, I reschedule the same backend workflow, but 24 hours later.
The problem is: This approach is not working. After I’ve kicked off the worklfow, there is no data in my database.
I don’t know if this is the best way to do it, but I was told to avoid to run a workflow on a list.
It would be cool to be able to use the retreived data in a repeating group in the frontend, too.
Thanks in advance!