Bug with formula lookup field definition?

I’m using the fields endpoint on one of my tables to power some code generation, and I think I’ve found a bug in one of the definitions, namely this one:

      id: 4795,
      table_id: 516,
      name: 'Project',
      order: 6,
      type: 'formula',
      primary: false,
      read_only: true,
      date_include_time: null,
      nullable: true,
      number_decimal_places: null,
      error: null,
      date_force_timezone: null,
      duration_format: null,
      date_time_format: null,
      array_formula_type: 'text',
      date_format: null,
      date_show_tzinfo: null,
      formula: "lookup('Task', 'Project')",
      formula_type: 'array'

This definition seems to imply that the returned data for that field should be of type string[], however it actually returns this, since Task.Project is a link row field:

  ids: { database_table_65: 9, database_table_515: 72 },
  value: 'Primary Field Text'

Can field definitions for formulas with lookups be updated to be more accurate, or at least to not imply a type of string[]?

Also thinking about this, is the field definition actually accurate, and array_formula_type is referring to the type of the value within the object, making that object format a type of value wrapper that I should expect could potentially appear anywhere?

If that’s the case I might like the IDs to also include the ID of the source field, and not just the table and row IDs that I’m interpreting that object to be including.

Hello @narthur,

which endpoint is returning such data?

The array returned consists of objects. Each object has an id and a value key.

The id is the id of the row in the linked table.

The value is the value of the primary field in the linked table.\

So in this case if you try to look at the data sent for a row, you’ll be able to see something like this:

    "id": 1,
    "order": "1.00000000000000000000",
    "field_1": "",
    "field_2": [
            "id": 2,
            "value": ""
            "id": 7,
            "value": "Stephanie Cole"
            "id": 10,
            "value": "Kelly Chambers"

where field_2 is a lookup field to a text field in the linked table.

You can also see an example of the data by looking the the API docs of your table

Screenshot 2024-04-16 at 14.34.04