Covid19 dashboard - need help with dynamic apis

Hey there,

I’ve been recently putting up together a simple dashboard to follow on the virus. (https://covid19-20.bubbleapps.io/

I am doing it for fun and many of my relatives find it useful to follow on worldwide cases, I’m looking to improve it and add more features (started about 2 hours ago).

I need help with optimizing the search, as currently I am using probably a ‘stupid’ method but this is all I could think about. Once I click on the ‘search input’ the app stuck for a few seconds and only after shows result.

Link to the editor: https://bubble.io/page?type=page&name=index&id=covid19-20&tab=tabs-1

I am pretty sure someone will have a better solution for it, also if anyone would like to join and has some ideas I’m open to hear :slight_smile:

It’s incredibly hard to figure out what you are actually wanting here. Do you want someone to login to your app and finish it for you? What are you searching for specifically? Which services are you connecting to via API?

Without any real detail it’s impossible to help and 9/10 people are not going to go into your app without knowing anything and try to figure it out for themselves.

I hope I don’t come off as rude, but you have to give us a lot more to go on man.

Let’s take it step by step:

  1. Click the link: https://covid19-20.bubbleapps.io/
  2. Try to search for your country
  3. Bubble is stuck for 3-5 seconds
  • So problem defined.

What am I trying to achieve? I am trying to eliminate this weird lags.
There are only few elements in the app:

  • Search input
  • Repeating group showing api results
  • Group showing search result

Group and repeating are showing/hidden based on custom state.

Hope it make sense.

Instead of hiding your repeating group and showing a new group completely based on the data found in the search input, I would just modify the results of the repeating group.

I’m pretty sure it freezes because with your conditional statements you hide the repeating group and show a new group that is instantly pinging the url for new data as soon as you type something into the box resulting in an incomplete search query… “https://coronavirus-19-api.herokuapp.com/countries/U/” instead of “https://coronavirus-19-api.herokuapp.com/countries/UnitedStates/”.

You could also try triggering a workflow when the search icon is clicked to hide the repeating group and show the hidden group so that it can search for the whole name of the country before pinging the API.

This method doesn’t work as the repeating group API, and the group API are 2 different data types. Only one of them is a List of Things.

I do not completely understand what do you mean by triggering a workflow. I’ve removed the conditions and added a search button that would show the search result.

The problem remains. (here’s the updated version - https://covid19-20.bubbleapps.io/version-test/)

Well it works as intended now, but the delay comes from the data transfer rate of the API. Like you said it’s two separate data sources, so it’s loading the data from the source again completely so there’s not a way to reduce the wait time.

If you were to just filter the repeating group to show only results with the country data matching the search bar it wouldn’t have to call the API a second time and would appear more instant.

Also, not a terrible idea to have a reset button that reverts the switch from the repeating group to the stand alone group.