# Best way to do a formula when saving when there's many different variables

Hi everyone, I was wondering the best way to accomplish something like this in Bubble. Here’s a screenshot to help illustrate, this just shows 5 values but I actually have more like 35:

When I create a particular record, there’s a popup that opens where I can select input values. There’s 3 different dropdowns to pick from, “Access Type”, “Revenue Type”, and “Solo Line.” I then have a field called “Comp Rate” and basically I need that field to populate with a number based on what the other 3 fields have.

So using the example above, here’s a few possible scenarios:

If Access Type = OPTION A, and Revenue Type = 2, and Solo Line = A, then Comp Rate = 0.12

If Access Type = OPTION C, and Revenue Type = 4, and Solo Line = A, then Comp Rate = 0.07

And so on, hopefully that makes sense. The challenge of course is that I have basically like 12 rows in reality like this, and as you can see on many of the values there’s also multiple options, like the first row technically has 2 outcomes that could = 0.12, as Access Type could be OPTION A, with Solo Line being A, but Revenue Type can be 1 or 2 and so on.

I had thought I’d just code it as workflows with conditions, like “When record is saved, if Access Type = OPTION A, and Revenue Type = 1, and Solo Line = A” and then have the workflow set the field to 0.12 and so on, but there’s just so many possible outcomes.

I also would love if possible to have this table as an actual Bubble table so that I can change the values periodically vs being hard coded in, which I guess would do a search for instead against the comp values table.

Is this how it would be done, or are there easier or better ways to accomplish this? It just seems like way too much work doing 35 workflows like that to handle every possible outcome. I’ll probably have our developer look into this instead of doing it myself but just wanted to check in case there’s something more obvious I’m missing. Thanks!