Dynamic Variable

Hi TB Community,

It's been a while since I've been creating snippets so I forget if my request is even possible/what the simple solution would be

Occasionally - when calculating the potential returns from a rental property- the current rents are actually higher than the projected max rents for an area.

For this reason I created a toggle which would allow me to enter the current(ly higher) total rents, with hopes to override the "calctotalrents" which is calculated by pulling data from a DB table. And then is subsequently used in many later calculations (to determine percentage rental returns)

Can someone please remind me if it would be possible to write something into the calctotalrents formula to use the higherrents variable if it is not blank, otherwise, it should just operate as normal?

Thank you in Advance!

Hello :slight_smile:

Could you create an if statement that says: if the 'Current Rent Higher Than Market?' field is toggled on, then the formula in the table changes to how you need it (and maybe adds a named form field where you can enter the current rent)?

You can put an {else} field in the condition so that if it is toggled off, then your normal formula is used.

Does that make sense? If so, please give it a try and let me know if it works.

1 Like

Hi Dylan - Yes that worked - Thank you very much! :slight_smile:

My simple solution was to add this to to the beginning of the calctotalrents variable:
higherrents if Current Rent Higher Than Market?="Yes" else....

1 Like