nextcloud / nextcloud/tables

/rows/simple api endpoint doesn't return proper values + comment on /rows

Open
#612 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Steps to reproduce
  1. create a table with columns of type link/url and selection.
  2. add a row
  3. query the api
Expected behavior

/rows/simple should return:

[['link', 'select'], ['http://example.com', 'choice 1']]

The same should be true for all column types.

Actual behavior

It returns:

[['link', 'select'], ['{"title":"http://example.com","subline":"URL","providerId":"url","value":"http://example.com"}', [0]]]

The link is a json string that I could parse if I was expecting it and the [0] is completely useless.

Tables app version

0.6.0

Browser

No response

Client operating system

No response

Operating system

No response

Web server

None

PHP engine version

None

Database

None

Additional info

The normal /rows endpoint is IMHO also not ideal. Depending on the column type the value is formatted in completely different ways. It can be a string, a json string or a list of integers that point to a list entry somewhere else. According to the the API documentation it should always be a string. This is probably a difficult problem to solve but I think it would be good if you could find a more consistent/uniform way of presenting that data.
I'm currently not really sure what type of values this API is supposed to return. Should it be a simple string for the link or json? And should the the value of a selection column be a list of indexes or the actual values, possibly as csv if there are more than one?

And the fact that the formatting differs based on the version of tables that was used to enter the data doesn't make any of this easier.

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 against the /rows/simple and /rows endpoints using link/url and selection columns, then compare both responses with the API documentation. The work is complete when the expected value representation is decided and applied consistently across column types, including data created with older Tables versions.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.