Loss of data object in API

Wappler 5 b6
Windows 10pro
Mysql
PHP

Loss of data object in API

When adding a related table I lose the data object in the API

@patrick ?

Could you post the json of the server action.

Wappler 5. b7
Windows 10pro
php
Mysql

no pivot_table

{
“meta”: {
“$_GET”: [
{
“type”: “text”,
“name”: “buscar”
},
{
“type”: “text”,
“name”: “offset”
},
{
“type”: “text”,
“name”: “limit”
},
{
“type”: “text”,
“name”: “sort”
},
{
“type”: “text”,
“name”: “dir”
},
{
“type”: “text”,
“name”: “grupo_acesso”
}
]
},
“exec”: {
“steps”: {
“name”: “query”,
“module”: “dbconnector”,
“action”: “paged”,
“options”: {
“connection”: “db”,
“sql”: {
“type”: “SELECT”,
“columns”: [
{
“table”: “usuarios”,
“column”: “*”
}
],
“table”: {
“name”: “usuarios”
},
“primary”: “id”,
“joins”: ,
“wheres”: {
“condition”: “AND”,
“rules”: [
{
“id”: “usuarios.nome”,
“field”: “usuarios.nome”,
“type”: “string”,
“operator”: “contains”,
“value”: “{{$_GET.buscar}}”,
“data”: {
“table”: “usuarios”,
“column”: “nome”,
“type”: “text”,
“columnObj”: {
“type”: “string”,
“maxLength”: 255,
“primary”: false,
“nullable”: true,
“name”: “nome”
}
},
“operation”: “LIKE”
},
{
“condition”: “AND”,
“rules”: ,
“conditional”: “{{$_GET.grupo_acesso}}”
}
],
“conditional”: null,
“valid”: true
},
“orders”: [
{
“table”: “usuarios”,
“column”: “nome”,
“direction”: “ASC”,
“recid”: 1
}
],
“query”: “SELECT \nFROM usuarios\nWHERE nome LIKE :P1 / {{$_GET.buscar}} */ AND ()\nORDER BY nome ASC”,
“params”: [
{
“operator”: “contains”,
“type”: “expression”,
“name”: “:P1”,
“value”: “{{$_GET.buscar}}”
}
]
}
},
“output”: true,
“meta”: [
{
“name”: “offset”,
“type”: “number”
},
{
“name”: “limit”,
“type”: “number”
},
{
“name”: “total”,
“type”: “number”
},
{
“name”: “page”,
“type”: “object”,
“sub”: [
{
“name”: “offset”,
“type”: “object”,
“sub”: [
{
“name”: “first”,
“type”: “number”
},
{
“name”: “prev”,
“type”: “number”
},
{
“name”: “next”,
“type”: “number”
},
{
“name”: “last”,
“type”: “number”
}
]
},
{
“name”: “current”,
“type”: “number”
},
{
“name”: “total”,
“type”: “number”
}
]
},
{
“name”: “data”,
“type”: “array”,
“sub”: [
{
“type”: “number”,
“name”: “id”
},
{
“type”: “datetime”,
“name”: “data_cadastrado”
},
{
“type”: “datetime”,
“name”: “data_atualizado”
},
{
“type”: “text”,
“name”: “nome”
},
{
“type”: “text”,
“name”: “telefone”
},
{
“type”: “text”,
“name”: “celular”
},
{
“type”: “text”,
“name”: “email”
},
{
“type”: “text”,
“name”: “cpf”
},
{
“type”: “text”,
“name”: “cnpj”
},
{
“type”: “text”,
“name”: “empresa”
},
{
“type”: “datetime”,
“name”: “ultimo_acesso”
},
{
“type”: “boolean”,
“name”: “juridica”
}
]
}
],
“outputType”: “object”
}
}
}

Whit pivot table

{
“meta”: {
“$_GET”: [
{
“type”: “text”,
“name”: “buscar”
},
{
“type”: “text”,
“name”: “offset”
},
{
“type”: “text”,
“name”: “limit”
},
{
“type”: “text”,
“name”: “sort”
},
{
“type”: “text”,
“name”: “dir”
},
{
“type”: “text”,
“name”: “grupo_acesso”
}
]
},
“exec”: {
“steps”: {
“name”: “query”,
“module”: “dbconnector”,
“action”: “paged”,
“options”: {
“connection”: “db”,
“sql”: {
“type”: “SELECT”,
“columns”: [
{
“table”: “usuarios”,
“column”: “*”
}
],
“table”: {
“name”: “usuarios”
},
“primary”: “id”,
“joins”: ,
“wheres”: {
“condition”: “AND”,
“rules”: [
{
“id”: “usuarios.nome”,
“field”: “usuarios.nome”,
“type”: “string”,
“operator”: “contains”,
“value”: “{{$_GET.buscar}}”,
“data”: {
“table”: “usuarios”,
“column”: “nome”,
“type”: “text”,
“columnObj”: {
“type”: “string”,
“maxLength”: 255,
“primary”: false,
“nullable”: true,
“name”: “nome”
}
},
“operation”: “LIKE”
},
{
“condition”: “AND”,
“rules”: ,
“conditional”: “{{$_GET.grupo_acesso}}”
}
],
“conditional”: null,
“valid”: true
},
“orders”: [
{
“table”: “usuarios”,
“column”: “nome”,
“direction”: “ASC”,
“recid”: 1
}
],
“query”: “SELECT \nFROM usuarios\nWHERE nome LIKE :P1 / {{$_GET.buscar}} */ AND ()\nORDER BY nome ASC”,
“params”: [
{
“operator”: “contains”,
“type”: “expression”,
“name”: “:P1”,
“value”: “{{$_GET.buscar}}”
}
],
“sub”: {
“piv_grupo_acesso”: {
“table”: {
“name”: “usuario_piv_grupo_acesso”,
“alias”: “piv_grupo_acesso”
},
“key”: “usuario_id”
}
}
}
},
“output”: true,
“meta”: [
{
“name”: “offset”,
“type”: “number”
},
{
“name”: “limit”,
“type”: “number”
},
{
“name”: “total”,
“type”: “number”
},
{
“name”: “page”,
“type”: “object”,
“sub”: [
{
“name”: “offset”,
“type”: “object”,
“sub”: [
{
“name”: “first”,
“type”: “number”
},
{
“name”: “prev”,
“type”: “number”
},
{
“name”: “next”,
“type”: “number”
},
{
“name”: “last”,
“type”: “number”
}
]
},
{
“name”: “current”,
“type”: “number”
},
{
“name”: “total”,
“type”: “number”
}
]
},
{
“name”: “data”,
“type”: “array”,
“sub”: [
{
“type”: “number”,
“name”: “id”
},
{
“type”: “datetime”,
“name”: “data_cadastrado”
},
{
“type”: “datetime”,
“name”: “data_atualizado”
},
{
“type”: “text”,
“name”: “nome”
},
{
“type”: “text”,
“name”: “telefone”
},
{
“type”: “text”,
“name”: “celular”
},
{
“type”: “text”,
“name”: “email”
},
{
“type”: “text”,
“name”: “cpf”
},
{
“type”: “text”,
“name”: “cnpj”
},
{
“type”: “text”,
“name”: “empresa”
},
{
“type”: “datetime”,
“name”: “ultimo_acesso”
},
{
“type”: “boolean”,
“name”: “juridica”
},
{
“name”: “piv_grupo_acesso”,
“type”: “array”,
“sub”: [
{
“type”: “number”,
“name”: “usuario_id”
},
{
“type”: “number”,
“name”: “grupo_acesso_id”
}
]
}
]
}
],
“outputType”: “object”
}
}
}

Hi @patrick could you please take a look at this?

I noticed that when linking a sub-table we lost the pagination and the data component

@George

Please try the following update.

dbconnector.zip (2.4 KB) Unzip to dmxConnectLib/modules.

1 Like