Forum Academy Marketplace Showcase Pricing Features

[solved] Values being saved to database incorrectly

So i am taking a quiz outcome score and saving it to the db. it should be a value between 0 and 1. it always saves as 1. even when the inspector says otherwise. this is shown in the video at the bottom.

I am doing some math in a RG using the Orchestra plugin from @vini_brito
i have a page State called totalCount
each cell has a checkbox,

I set totalCount to 0
I trigger my musicians to run a WF for each cell in my RG
if the checkbox is checked, add 1 to totalCount
when musicians have finished
create 1 new thing

  • text field = quiz name
  • number field = totalCount / RG:list of questions:count

the score always comes out as 0 in the db. what am I doing wrong?

Maybe do the calcs in the DB? Store total questions, Number selected. Do the math later.
It feels like the Thing is being saved before the calc is done on the UI. Maybe the input fields aren’t being set as/when they appear to be?

Just an idea to try - might shed some light on where the problem is.

it’s certainly strange and was working yesterday.

id think it was making the thing before the calculation but i dont think bubble let’s that happen. in the debug inspector, it shows it has a value being saved to the db.

later on I’ll get a pause in there for testing to see if a pause is helpful.

Any breakthroughs?

:rofl: I moved on to something else. I gotta come back to this eventually

It didn’t make sense though. If you watch the video. You’ll see that in step by step, the value populates in the inspector but isn’t carried over to the database.

Thanks for checking in on this, btw, @lindsay_knowcode

I was just thinking sometimes I’ve found “bugs” like this. For no reason whatsoever it isn’t working. But deleting the workflow and recreating from scratch just works - even if it seems identical. I think sometimes Bubble gets its references messed up but the issue checker doesn’t detect the issue.

1 Like

I ended up taking a different approach to solve this issue.

Instead of updating the total score during each round of the Orchestra plugin through the RG based on the value of the checkbox. i added these two workflows to change the value of total score immediately went any checkbox is checked or unchecked.

I also got away from several pages and put it all 3 quizzes into one page using page URL parameters to do some of the magic.

Here is a working example of a simple questionnaire that has several parts. saving all answers and subtotals to the db to then be represented later graphically. (mostly just the saving part is worked out . the results look pretty rough. )

What I was doing previously was wiping scores before it saved due to the way bubble runs workflow actions simultaneously when it can. I also just think this is a better approach for UX purposes.

This topic was automatically closed after 70 days. New replies are no longer allowed.