Calculation
This field is used to calulate a value based on the value of another field. This acts really helpful while calculating sums, averages etc among others.
{"type": "calculation","id": "age","label": "Number - 10","showInTable": true,"calculateValue": {"returnType": "number","dep": ["number1", "number2", "number3"],"exp": "(data.number1 + data.number2 + data.number3) / 3 || 0"}}
The example above is dependent on three fields with id's — number1, number2, and number3. It takes the average of the 3 and returns a number type. The user can modify the expression to their needs.
Field Attributes
Name | Type | Description |
---|---|---|
id | string | Assigns a name for the given field on the backend. This name can be used to refer this field in another field |
label | string | Adds a label to the given field |
isRequired | boolean | Makes a field mandatory |
showInTable | boolean | Displays the field in a table after saving the entry |
dep | object | Indicates the dependencies of the current field |
exp | string | Stores the expression to make the desired calculation |