Cflow provides a Time Calculation operation to perform calculations based on time fields. You can apply simple math operations and automatically populate the result in a target field. Time calculations use values from time fields, and only the minus operator is supported to find the difference between two times.
For example, in an organization, to calculate the total number of hours an employee has worked in a day, you can define the operation as shown in the screenshot below. When an employee enters values in the In Time and Out Time fields, the total number of hours is automatically calculated and displayed in the Total Hours field.
Steps to Configure Time Calculation
- Open your workflow from Workflow Setup.
- Go to the Form Creation tab and select the stage where the time calculation should be applied.
- Click on the field where the result will be shown (e.g., Total Hours).
- In the Field Properties panel, go to the Advanced tab.
- Under Time Calculation, click Add Operation.
- Define a condition (optional).
- Example: If Department = HR, perform the calculation.
Set up the calculation:
- Choose the IN-Time field as the base field.
- Select the operator (minus) to calculate the time difference.
- Choose the OUT-Time field as the value.
- Click Save to apply the configuration.
Example
In the screenshot below, the rule is set as:
If Department = HR, calculate the difference between IN-Time and Out-Time, and store the result in a target field (e.g., Total Hours).
This setup helps track the number of hours worked automatically when both time entries are filled.