nextcloud / nextcloud/tables

API view is returning only partial dataset in JSON, some column are missing.

Open
#1,008 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug feature: api
Dominant language
JavaScript
Stars
214
Forks
52
Avg merge
1d 10h
Merged PRs (30d)
82

Description

Steps to reproduce
  1. Create table, add some columns, example: fristname, lastname, email
  2. also add a column as choice with a default value checked, example: status: [new, in_progress, error]
  3. add some rows (without filling choice column letting default value)
  4. add one row with choice column value forced (may be default value)
  5. Create a view on a the table
  6. add some metdata column like ID or createdBy
  7. This is correctly displayed in the web browser (including filled default values)
  8. call API /index.php/apps/tables/api/1/views/{viewId}/rows ==> only partial data are displayed in JSON

all data shown are fake randomly generated

My view
image

form the table
image

Expected behavior

All data, including default value, if any, should be send as JSON result. This actually work in the View export as CSV were all data are pushed to the CSV (except unfilled default value left as blank)

Here API call is not consistent, with the data visually available on the browser.

Actual behavior

Partial data set is returned

calling API /index.php/apps/tables/api/1/views/{viewId}/rows

[
  "troncated_data[...]" : "I  didn't paste all data",
  {
    "id": 2031,
    "tableId": 4,
    "createdBy": "admin",
    "createdAt": "2024-04-26 12:56:13",
    "lastEditBy": "admin",
    "lastEditAt": "2024-04-26 12:56:13",
    "data": [
      {
        "columnId": 25,
        "value": "igor@email.invalid"
      },
      {
        "columnId": 24,
        "value": "Dosgor"
      },
      {
        "columnId": 23,
        "value": "Igor"
      }
    ]
  },
  {
    "id": 2032,
    "tableId": 4,
    "createdBy": "admin",
    "createdAt": "2024-04-26 13:00:21",
    "lastEditBy": "admin",
    "lastEditAt": "2024-04-26 13:00:21",
    "data": [
      {
        "columnId": 25,
        "value": "ivanoe@terrible.email"
      },
      {
        "columnId": 24,
        "value": "Leterrible"
      },
      {
        "columnId": 23,
        "value": "Ivan"
      }
    ]
  }
]
Tables app version

0.7.0

Browser

125.0 (64-bit)

Client operating system

xubuntu 22.04

Operating system

Linux debian 12 (64 bits)

Web server

None

PHP engine version

PHP 8.2

Database

PostgreSQL

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through /index.php/apps/tables/api/1/views/{viewId}/rows with a table containing ordinary columns, a choice column with a default, and metadata columns. Compare the JSON response with the browser view and the View export as CSV; done means the API includes every displayed column and its default value.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, postgresql
Domain
api, backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.