Reusable formulas with variable

Hello everyone,

When I create a reusable formula, how do I define which value is going to be used as a variable?

Let’s say I create a simple formula that always multiply a number from an input 1,000 times, so:
‘input a - value’ * 1000

Then I name this formula “mult1000” and it becomes available as “mult1000()”.

Is it possible to make “input a - value” replaceable and then pass the variable inside the formula, like: mult1000(‘input b - value’)

It probably has a very simple answer that I was not able to find in the documentation.

I imagine you are looking to add parameters to the formula, then create the formula referencing those parameters, and lastly, passing parameters into the formula when referencing it in the project.

In the screenshots below, I’ve created a formula called multiply which has 2 parameters: a and b (which are set to 1 and 1,000 for testing). I then edit the formula so that these 2 parameters are used, which you’ll see in the popover to the right. These parameters can be found under the tab with the lightning bolt icon.

Tip: if you add a description for the formula, it will output as a tooltip to provide nice hint text. See last screenshot for example of tooltip with hint text.

With the formula built, I can now reference it in my project. Below you’ll see I am binding to text, and setting that text to the output of my formula, in which I decided to pass 2 and 1,000.

That’s exactly what I was looking for and failed to figure out on my own.

Thank you so much!