I created a finance app as an exercise to learn how to use Bubble. I was able to get very close to my goal, but I’m stuck on the last part.
I’m trying to populate a chart with Calculated Data from a repeating group input element. I have a feeling that I’m having trouble because I may have not setup the input element properly. Here’s a link to my app:
Email:
demo@example.com
Password:
temppass
I was having trouble creating a running balance from the data in the repeating group. I ended up getting it to work by setting to ‘Initial Content’ of an input element in the repeating group like this:
This allows the Running Balance to be updated automatically if either the Date is changed and the transaction moved up or down in the list, or the transaction amount changes.
However, since the input is not linked to any workflow, and Running Balance data is not being saved anywhere, I am struggling to get the chart above the transaction list to show Running Balance data. Currently the chart is only populated with transaction data.
I tried the following 3 ways to get the data populated but none of them seems to work:
1.) Use the same call on the chart element as I used for the Initial Content field on the repeating group input above.
The value and label expression in the chart element do not allow me to use the above call since it does not reference a Data Type stored in the database.
2.) Add a running balance field to the Transaction type and save the data there.
Sorry didn’t get a screenshot of the before I made other changes
This partially works, however if the date field is changed on any transaction the chart does not display correctly because the static running balance data in the transaction does not match the updated initial content of the running balance input field in the repeating group. I tried updating all transactions simultaneously, but I wasn’t able to get it to update each transaction with the unique running balance. I was only able to update ALL transactions with a single running balance. So the chart incorrectly displayed ALL transactions with the same running balance.
I was also thinking that this would not be an ideal solution in the end anyway since it would required a lot of resources to update so many records at one time every time I made a change to a transaction.
3.) Add running balance and running date list fields to the Account type to store the data for both as an array.
Sorry didn’t get a screenshot of the before I made other changes
I was able to get the running balance for a single transaction, but not for each cell in the repeating group. This might be possible if I could create a loop for each transaction in the repeating group, but I couldn’t figure out how to do that. Even so, I tried manually entering an array in the database, but the chart plugin did not allow me to populate points that way.
At this point I’m out of ideas so I’m not really sure where to go from here. Any help that could be provided would be greatly appreciated.
Update 06/22/2017
My biggest hurdle for solving this issue depends on properly maintaining a running balance, so I created a new question here:
How do I keep a Running Balance on a Field?