Forum Academy Marketplace Showcase Pricing Features

Custom state calculation - how to


I’m trying to set a value for a custom state, based on another custom state value and I would like to use a kind of “switch structure” - for those familiar with standard coding.

To be more specific:

  • if customState1 is between 0 and 10, custom State2 must be set to 1
  • if customState1 is between 11 and 15, custom State2 must be set to 2
  • if customState1 is greater than 15, custom State2 must be set to 3

How can I do that in Bubble ?

Thanks for your help.

I’m not sure if I did the right thing but here’s what I did, it may help other people :

  • I created an input on my page that I mage invisible
  • Inside this input I created my conditional rules, based on the conditions I explained above. For example if custom state is <= 10 then the input default value is 1, and so on
  • Finally I use workflow to set my new custom state value, which is the default value of the input

I hope my explanations are clear. If you know any other better way, please tell me, but this one is working.

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