How Can We Help?
< All Topics
Print

What is a Formula Widget

Formula Widget

Drag the ‘Formula’ widget from the left panel and drop it to the middle digital mobile screen to include formula in your workflow. Formula widget can be used in your workflow to include operations that can make computation easy. Operations like addition, subtraction, division, multiplication, can be easily integrated as logic into your forms.

The widget is used to set a dynamically calculated value to itself, based on the values (responses) of the other fields. The value which is returned from the code, gets set to the formula field in the workflow. For example, if you have created 3 text boxes to capture the number of fire extinguishers at 3 different premises. You can then use a formula widget for a total number of fire extinguishers found at premise 1, premise 2, and premise 3. Using a formula widget, you can add the inputs from 3 text boxes and get ‘Total number of fire extinguishers at all the premises.’

A few samples are described below to help the Workflow Builder understand the use of this widget.

Sample 1:

function compute(){

//enter code here

var sum = parseInt(Number_1) + parseInt(Number_2);

return sum;

}

Sample 2:

function compute(){

//enter code here

var Full_Name = First_Name + “ “ + Last_Name;

return Full_Name;

}

Sample 3:

function compute(){

//enter code here

if(parseInt(marks) > 40)

return “Pass”;

else

return “Fail”;

}

Table of Contents