OpenRefine / OpenRefine/openrefine.org

Correct documentation for row.record.cells variable

Open
#494 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
TypeScript
Stars
161
Forks
142
Avg merge
6h 10m
Merged PRs (30d)
9

Description

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"].value
  • row.record.cells["column name"].recon
  • row.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
`

Contributor guide

No contributing guide indexed for this repository

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 with the documentation entry for row.record.cells and review the linked forum discussion for the expected behavior. Update the description to identify the RecordCells object, show column-name access and cell-property examples, and explain the non-blank cell behavior; done when the documentation matches these examples.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.