Go to website
Posts related to our API and fields/visibility scripts.
Script to set number of digits after decimal point
By using a script within a calculated field, you can perform arithmetic operations that involve multiple fields in your form. For instance, if you want to multiply fields 'A' and 'B', you can use this script: Flokzu.getFieldValue([[A]]) * Flokzu.getFieldValue([[B]]) While this script works and is valid, it is possible that multiplying numbers with decimals results in an infinite number of decimals. To avoid this, we can modify the function in the following way and limit the number of
How to set up visibility by script?
Visibility by script allows you to set dynamic visibilities for form fields. You can define if certain fields should be required, editable, read-only or hidden, based on the value of another field or on a decision made. Available functions Flokzu’s API offers the following functions to use in scripts: Flokzu.setHidden( [field] ); //Hides a field Flokzu.setRequired( [field] ); //Sets a certain field as required Flokzu.setEditable( [field] ); //Sets a certain field as editable
[Example] Script to calculate difference between two times
With Flokzu, creating a calculated field that at all times displays the difference (in hours) between 2 Time fields is super easy. Step 1 Add two Time fields (e.g. 'Time A' y 'Time B'). Step 2 Add a calculated field (e.g.: 'Difference') Step 3 Add the following script to the calculated field