NotesViewColumn: Reading a View's Columns, Their Formulas, and Sorting in Code

NotesViewColumn: Reading a View's Columns, Their Formulas, and Sorting in Code

Jun 26, 2026 429 words

You inherit an undocumented database and want to figure out what a view actually looks like: which columns it has, whether each shows a field or a formula, which are sorted, which is a category, which are hidden. Clicking through Designer column by column works — but what about a tool to inventory dozens of views?

That’s what NotesViewColumn is for. The official definition: “Represents a column in a view or folder.” It lets you read a view’s column definitions from code — the same “read the design” capability as the earlier NotesForm piece reading form design. And it lines up neatly with the recent NotesViewEntry: the values in ViewEntry.ColumnValues correspond to exactly these columns.


TL;DR

  • Get it from NotesView’s Columns property (an array of all the view’s columns).
  • Read the title and source: Title (column header), ItemName (the programmatic name, usually the field name), Formula (if the column is a formula).
  • Tell the column’s type: IsField (value comes from a field), IsFormula (value comes from a simple function or formula), IsCategory (it’s a category column).
  • Sorting and display: IsSorted, IsResortAscending, IsHidden, Width, IsResize.
  • Position — the column’s place in the view, left to right, starting at 1. That index lines up with ViewEntry.ColumnValues.

Getting and walking them

Dim view As NotesView
Set view = db.GetView("Orders")
Dim col As NotesViewColumn
Forall col In view.Columns
Print col.Position & ": " & col.Title & " (" & col.ItemName & ")"
End Forall

view.Columns gives you the array of the view’s columns; read each one’s properties and you’ve inventoried the whole view’s column structure.

What each property says

PropertyHolds
Titlecolumn header (read-write)
ItemName”the programmatic name of a column, which is usually the field (item) name” (read-only)
Formulathe column’s formula (read-write, if it’s a formula column)
Positionthe column’s place, left to right starting at 1 (read-only)
IsFieldwhether the value comes from a field (read-only)
IsFormulawhether the value comes from a simple function / formula (read-only)
IsCategorywhether it’s a category column (read-only)
IsSortedwhether it auto-sorts (read-write)
IsHiddenwhether it’s hidden (read-write)
Width / IsResizecolumn width / whether resizable

To “auto-generate view documentation,” these are the key ones: IsField / IsFormula distinguish a column that shows a field directly from one that’s computed; if it’s a formula, read Formula to pull that formula out.

Lining it up with NotesViewEntry

This is NotesViewColumn’s most useful pairing. The recent NotesViewEntry.ColumnValues piece flagged a trap: the n in ColumnValues(n) is the view’s column order, not a field name.

NotesViewColumn.Position is the source of that n. So you can build a “Position → Title / ItemName” lookup from view.Columns first, then read each entry’s ColumnValues and map “the value in column n” back to “what that column is” — which is the key combination for dynamic reports and exports where the columns aren’t hard-coded:

' build a column lookup first
Dim titles List As String
Forall c In view.Columns
titles(Cstr(c.Position)) = c.Title
End Forall
' then reading an entry's values maps back to column names

What about Java and SSJS?

LanguageCounterpartObtained via
Java (lotus.domino.*)ViewColumnview.getColumns()
SSJS / XPagesViewColumnview.getColumns()

Consistent across all three: getColumns() for the array, getItemName() / getFormula() / isCategory() and so on. When you write a Domino design-inventory or documentation tool, the column-property mapping here carries straight over.

Sources

← Back to all posts