There must be an easier way (tables and math)

Here is my app

and the live version

It works great. However, I feel like I brute forced the design of the internals and that there would/should have been an easier way with lists.

But I am not comfortable with lists. And the spreadsheet plug in I downloaded was not appropriate.

How would you have done this?

Why is the divi data data being stored in the database? It looks like the data is loaded via API and processed, without referring to previous state, and the database is a convenience for keeping it organised.

There’s a chain of calculations relying on results of other calculations, but Bubble doesn’t necessarily do them in the order you want, so some are being run before their dependencies, resulting in javascript errors. When the dependent values are done, the calculations are re-run because of the dynamic expressions, resulting in the correct results.

A more efficient and faster way is having each calculation only dependent on data that is available, which may mean repeating similar expressions in more than one place.

I agree that lists would be better, but Bubble’s list processing is clumsy when it comes to API results.

If I was doing this, I’d do almost all of the calculations in javascript, using JSON to pass in the API data, and JSON to return the results to Bubble. That would be exchanging “no-code” for speed :stuck_out_tongue:

Edit - I couldn’t figure out the significance of the naval vessel image.

There really isnt significance of the ship. These tools are for a specific cryptocurrency and its community. Its more of an inside thing.

The reason to have divi things as opposed to local states is to be able to keep a record of the changes in those things as time goes on. THAT data isnt relevant to the users of the site, but its relevant to me and other people. I’m using the site to create snapshots of the crypto economy.

but Bubble’s list processing is clumsy when it comes to API results

OK good. I agree.

If I was doing this, I’d do almost all of the calculations in javascript, using JSON to pass in the API data, and JSON to return the results to Bubble. That would be exchanging “no-code” for speed

I always find it curious when the answer to my question in the bubble forum is “do it in javascript” and other programming requirements. I’m not using bubble because I know those things and I think dealing with math in a totally disjointed way is fun. I’m using bubble because I don’t know those methods, and bubble seems to be the fastest means to the ends I want. I’m not a web developer.

Bubble doesn’t necessarily do them in the order you want

Yes, this is true. Its why I keep data covered for a while. I couldn’t figure out how to make the covers dependent on the data in the text boxes, so I just changed the states of the covers in the workflow.

Thank you for responding. I appreciate it.

Interesting … you could supplement this with an API workflow that also creates a snapshot at regular intervals, and both methods could check if there is an earlier one created recently before creating another.

I usually suggest this when it seems like it would make a big positive difference, but yes its not always an appropriate method.

Nice to see some state transitions :slight_smile:

Question (for next project)…

do “do every X seconds” workflows work when no one is logged in? Next, more complicated project needs to create daily reports for people who have user accounts. The need to be able to log in and gather the report which collates API retrieved data every day.