Dynamic change the estimation amount based on two different inputs

I am trying to change dynamically the estimation value based on two different inputs.

Basically each input is summed based on different prices, one price for adults and one price for children. So, when I add different amount of adults a price should be placed in the estimation value, but if I add children in the number of children’s input this sum has to be done from the amount of adults already calculated.

However, I can only add this sum all together not being able to see the amount estimation change dynamically from each input separatelly.


Make three custom states. One called Estimation that is a number with a default value of what it should be if by default you have 1 in the adult input, another called adultValue with a default value to equal what it should be if by default you have 1 in the adult input, and finally another custom state called childValue with the same default value logic. Then set the placeholder value of the Estimation Input to equal the custom state Estimation. When Input number of adults value is changed set the state of adultValue to input’s value * adult Price. Then next step set the state of Estimation and make it equal adultValue + childValue. Then do the same thing for if input child’s value is changed.

1 Like

Thank you very much for the replay. I did the solution adding a intitial value for each input. However, I will consider using your solution when I have a more advaced knowledge about bubble. I know few about it.

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