Display Events from Database and API Together

I have events on my app that are in my database but I am also planning to display events from an API that are not in my database. I need these events to show up in the same repeating group if possible upon searches. Is there a workaround I can use for this? Even just to display text and an image from an event whether it’s in my database or from API search if I have to?

The problem that I see is that they will be different data types, so you will need multiple repeating groups.

One possible solution I can think of (if feasible) would be to schedule a backend workflow to routinely synchronize the event data that you need from the API (text and image URL) to your database in the same Thing (or create a new Thing which combines both sources of event data).

This will also likely result in better search performance and much fewer calls to the API.

1 Like

The backend workflow is a solid idea and I honestly had that in place. The problem is that the API I’m calling to GET events from has literally like 18,000+ events. So, it was costing me money every time I called that API and tried to create a number of events in my database from those.

I’m thinking of creating a new dataset “race” and each one having ties to either an event in my system or a unique id for the event from API. Then the repeating group would show a “List of Races.” Then each cell would show either an event’s info from my database or from the API based on whether the “race” has a Bubble unique ID or a unique ID from the API. Thoughts?

Well actually, I don’t think that will work either because it would need to create a “race” in my system for each it pulls from the API, which completely defeats the purpose… not sure.

If you cache the results in your database, it may reduce API calls/cost in the long run, rather than calling the API for every search, and it should perform well.

You could try caching results on demand, but it will affect performance.

You could also investigate creating a backend workflow which merges your results with API results using some custom script. Although, this may also impact performance and use a lot of WU.

The simplest solution would be to separate the results into different repeating groups.

1 Like