**Why it's useful ?**

Creating a formula in a widget allows you to automatically calculate complex data and save your field operators time, while ensuring the accuracy of the information reported.

On this last widget, in the default value to perform a calculation, you must start with calc (, followed by the first tag of your widget, here it is the tag ## tag1 ##. As we want to do a multiplicaton, we will use this character "*" (as in Excel), followed by the second tag of the widget ## tag2 ##.

Which gives the formula calc (## tag1 ## * ## tag2 ##)

👇 Here's how it will look in the app :

**💡 GET A RANDOM NUMBER**

In some cases you want to get a random number (when you create an asset).

By selecting fx you can paste the following formula :**calc (random () * 1000000)**

This will randomly suggest a 10 digit number. Delete zeros if you want a shorter number.

- For a number
**attribute,**the parameters allow you to define a maximum and a minimum when creating this attribute. The maximum and minimum must be between 0 and 9999.

**Use functions**

You can use the **mean** function to calculate an average.

By writing the calc(mean(##Number1##,##Number2##), you will get the average of the numbers 1 and 2.

There is also the **std function** to calculate a standard deviation or the **abs function** to calculate an absolute value

## Comments

0 comments

Please sign in to leave a comment.