What Is The Result Component? #
The result field is the core of the application. This is where you define what to calculate and, more importantly, how to calculate other fields. It has a handy AI assistant to help you with formula generation in case you don’t like math.
Config Options #
Description #
The description helps provide additional context or information about the result field. You can update the description by typing it into the input field provided.
Sub description #
A sub-description lets you add more information and context to the result’s main description.
Prefix and Postfix #
Add text before and after the result value to provide units of calculation. Each field has a limit of 10 characters to ensure concise formatting
Hide #
The Hide toggle lets you permanently hide the result field. This is very useful when you want to break down your calculation into multiple steps and reference the result of that calculation in your other formulas. The hidden result is still displayed on the calculator editing page, but rest assured, it is not displayed on the embedded calculator.
Conditional Rendering Settings – PRO Feature #
Determines whether the result should be displayed or hidden based on certain conditions. This is typically useful when displaying a field based on another field or result value. You can define the conditional settings by selecting a field from the available list. Then, you must select the operation: more, less, equals, and finally, value. Once you define the condition, you can either show or hide the current field if it meets the condition.
Formula #
This is a place where the magic happens, kind of. The configuration consists of three main sections. Let’s break them down.
- Formula input field
- Action buttons
- Magic “Suggest formula” button
The formula input field lets you write the formula directly into the field. The input field allows to input of any number or any existing field letter in the calculator and is restricted to the following characters: ‘+’, ‘-‘, ‘/’, ‘*’, ‘%’, ‘^’, ‘(‘, ‘)’, ‘.’, ‘?’, ‘:’, ‘>’, ‘<‘, ‘=’, ‘&’, ‘!’, ‘|’.
Don’t worry. The formula validation runs as you type, so you get live feedback if there is any issue. It’s also worth mentioning that when you type a formula, do not insert any spaces.
The second section is a shorthand for the most commonly used operations, but I would like to pause on the IF/ELSE button.
If Else Statements in Formula #
The If/Else button opens up the following condition builder.
The visual builder is simple to use. You populate the condition you want to check. You can also reference the field letters in the builder that the value will be replaced during the evaluation.
So, for example, you can write the following condition: A<B.
This condition checks if A is less than B. If true, the evaluation will return the value; otherwise, it will return another value.
Here is what it looks like:
This condition means that if A is less than B, we want to use the value of A; otherwise, we use the value of B. Once you press the OK button, the expression will be appended to the formula input box and evaluated. The output will look like this: (A<B?A:B)
I know it’s not the most obvious initially, but once you get used to it, it will make sense. Note the question mark (?) and colon (:). You can think of a question mark as if you are asking question A<B? and the colon as the divider between true and false A<B?A:B.
Here is the allowed list of conditions for your convenience:
- < Smaller than (A<B)
- > Larger than (A>B)
- <= Smaller or equal (A<=B)
- >= Larger or equal (A>=B)
- == Equals (A==B)
- != Not equals (A!=B)
You can add multiple conditions using the & (AND) and | (OR) operators. If you want to combine multiple conditions to evaluate, the visual builder does the job for you.
Say we want to check that A plus ten is less than B AND B is more than C. We would write – (A+10)<B&B>C
It’s important to note that brackets matter, and omitting them can cause the evaluation to return an incorrect value.
Tip: If you are comfortable with conditional logic, you don’t need to use the UI builder; you can write your condition directly into the formula input.
AI Assistant – PRO Feature #
Now, to the magic button. It’s pretty simple: You just press the button and wait a few seconds to get your formula back. Here is how it works.
AI analyzes the calculator and determines what you want to calculate. To get the most accurate results, ensure your fields and results are as descriptive as possible. This is good for users and helps our model figure out the right formula.
If the model doesn’t get enough context, it will tell you that you need to provide more descriptive fields.
Note: The AI formula helper is constantly under development and might not always return the expected calculation. Validate that the suggested formula is correct.
Decimal points #
Set how many decimal points you want to display in your result.
Align and Accent #
Align lets you align the results to the Left, Right, or Center. The Accent section allows you to select how the result field should be accented. You can choose between accenting the background, border, text, or no accent at all.