Context:
The Coda API enables specifying a visibleOnly
param when retrieving a Table’s rows, which is documented as: “If true, returns only visible rows and columns for the table.” (see Coda API (v1) Reference Documentation).
Problem:
The problem comes with this specific use case of attempting to retrieve the rows of a given table in their natural order, including the fields for any hidden (non-visible) columns. Although this seems like it should be possible (and the documentation does not mention any reason it shouldn’t be), it is not possible, as in order to retrieve the rows in their natural order, the visibleOnly
param must be set to true:
This ordering is only meaningfully defined for rows that are visible (unfiltered). Because of this, using this sort order will imply visibleOnly=true, that is, to only return visible rows. If you pass sortBy=natural and visibleOnly=false explicitly, this will result in a Bad Request error as this condition cannot be satisfied.
The restriction that only the visible rows may be returned makes sense, but the restriction on the visible columns does not. This artificially restricts the functionality of this endpoint, and there is no real way to emulate this functionality as a consumer of the API. The root cause of this is that the visibleOnly
param serves two uses in this context. The solution would be to factor them out into visibleRowsOnly
and visibleColumnsOnly
params.