Correct documentation for row.record.cells variable
From Forum https://forum.openrefine.org/t/row-record-cells-is-not-an-array/2620/7
The documentation currently has the entry:
| Field | Meaning |
|---|---|
row.record.cells |
An array of the cells in the given column of the record |
This is both incorrect (this actually returns a RecordCells object) and isn't incredibly helpful to the user as it is not obvious how to extract cell objects or their properties (particularly values) from this object. It is required to provide a column name to get an array of Cell objects. e.g:
row.record.cells.columnName
or
row.record.cells["column name"]
This returns an array of the non-blank cells in that column in the record. The properties of the cells in the array can be extracted by dot chaining the relevant cell property on the end:
row.record.cells["column name"].valuerow.record.cells["column name"].reconrow.record.cells["column name"].errorMessage
But note that unless the value is set, the cells won't be included in the array - so cells that are storing an errorMessage rather than a value won't be included. (I'm not sure if it is possible for a cell to store an error message and a value?)
At the least the documentation should be updated to indicate users should use row.record.cells.columnName or row.record.cells["column name"] to get the cells from which values can be extracted
`