[Bug?] Text-type lookup is returned in /columns API call as being "isArray": false, yet its values appear as an array in the /rows call

Here’s the response from the call to /columns, at path body.items[4]

{
id:"c-LRNW7sg1lJ"
type:"column"
name:"Dependent tasks"
href:"https://coda.io/apis/v1/docs/xM_oRCZcyq/tables/grid-1XjiHhpHtg/columns/c-LRNW7sg1lJ"
calculated:true
format: {
  type:"text"
  isArray:false
}
formula:"[Task tracker].Filter(Prerequisite=thisRow)"
}

And here’s the response from the call to /rows for the same table, at path body.items[0].values:

{
Task:"```Adapt Cats: The musical script for virtual audience```"
Start date:"2024-01-08T00:00:00.000-07:00"
End date:"2024-01-26T00:00:00.000-07:00"
Prerequisite:""
Dependent tasks: [{
  @context:"http://schema.org/"
  @type:"StructuredValue"
  additionalType:"row"
  name:"Hold auditions"
  url:"https://coda.io/d/_dxM_oRCZcyq#_tugrid-1XjiHhpHtg/_rui-VxM4YybX_j"
  tableId:"grid-1XjiHhpHtg"
  rowId:"i-VxM4YybX_j"
  tableUrl:"https://coda.io/d/_dxM_oRCZcyq#_tugrid-1XjiHhpHtg"
}]

I’m using one of the quickstart examples, can find which one.

Other observations:

  • this seems to happen regardless of how many items are in the lookup
  • this seems to happen only when the column type is String, not a proper Relation type.

Is this intended behaviour?

Hi @louca.developer - I think unfortunately the answer is yes. Although Coda has typed columns, we don’t completely prevent a user from entering content into that column that doesn’t match the type. For example, you can create a number column and type text into it. The /columns endpoint will report it as type number but the /rows endpoint will return the text value.

In this case likely the column is declared as a text column, but via formula has a relation content inserted into it. Dealing with the messiness of tables is challenging when working with the API, and if you have ideas of ways we can improve that let me know.