I’m trying to get grant total in front-ent side.
.toNumber() just returns nothing.
Here is my data binding:
But 0 returned even on back-end side:
Full code
{
"meta": {
"$_GET": [
{
"type": "text",
"name": "sort"
},
{
"type": "text",
"name": "dir"
}
],
"$_POST": [
{
"type": "text",
"name": "test"
}
]
},
"exec": {
"steps": [
{
"name": "project",
"module": "core",
"action": "setvalue",
"options": {
"value": 3
},
"outputType": "number"
},
{
"name": "query_get_expenses",
"module": "dbconnector",
"action": "select",
"options": {
"connection": "db",
"sql": {
"type": "SELECT",
"columns": [
{
"table": "expenses",
"column": "amount_expense"
},
{
"table": "expenses",
"column": "price_expense"
}
],
"table": {
"name": "expenses"
},
"joins": [],
"wheres": {
"condition": "AND",
"rules": [
{
"id": "expenses.service",
"field": "expenses.service",
"type": "double",
"operator": "equal",
"value": "{{project}}",
"data": {
"table": "expenses",
"column": "service",
"type": "text"
},
"operation": "="
}
],
"conditional": null,
"valid": true
},
"query": "SELECT amount_expense, price_expense\nFROM expenses\nWHERE service = :P1 /* {{project}} */",
"params": [
{
"operator": "equal",
"type": "expression",
"name": ":P1",
"value": "{{project}}"
}
]
}
},
"output": true,
"meta": [
{
"name": "amount_expense",
"type": "number"
},
{
"name": "price_expense",
"type": "number"
}
],
"outputType": "array"
},
{
"name": "test_value_copy",
"module": "core",
"action": "setvalue",
"options": {
"value": "{{query_get_expenses.sum('price_expense * amount_expense')}}"
},
"outputType": "number",
"output": true
}
]
}
}