Skip to content

jx:updateCell

jx:updateCell replaces a single cell’s value with the result of an expression. Use it for summary cells, totals, timestamps, or any standalone computed value.

jx:updateCell(lastCell="A1" updater="totalAmount")
AttributeDescriptionRequired
lastCellThe cell to update (typically same as the command cell)Yes
updaterExpression whose result becomes the cell valueYes
data := map[string]any{
"employees": employees,
"totalAmount": 15750.50,
"reportDate": "2024-01-15",
}

Template cell A10 comment:

jx:updateCell(lastCell="A10" updater="totalAmount")

Cell A10 in the template can contain any placeholder text — it gets replaced with 15750.50.

Regular ${...} expressions work for most cases. jx:updateCell is useful when:

  • The cell is outside a loop and you want to set it from a specific context variable
  • You need the update to happen after other commands have run (it respects command ordering)
  • Don’t reach for it first. 9 times out of 10, a plain ${...} expression in the cell value is simpler and does the same thing. Use jx:updateCell only when ordering matters.
  • lastCell is the single target cell, not a range. The command updates exactly one cell.
  • The updater value is an expression, not just a variable name. updater="totalAmount * 1.1" is valid.

Browse all 19 runnable examples with input templates and filled outputs on the Examples page.

Auto-fit row heights for cells with wrapped text:

jx:autoRowHeight →