mutable

mutable, keyword

The mutable keyword declares a dash-mutable variable or marks a writeable value inside an interactive tile. Mutable variables are initialized during the processing phase and can be edited by the dashboard viewer.

Example

read upload "values" as Submitted with
  Id : text
  Value : number

table T[id] = with
  [| as id, as Value |]
  [| "A", 1 |]
  [| "B", 2 |]

mutable T.Value = single(Submitted.Value) by Submitted.Id at T.id default 0

show table "Values" editable: "values" with
  T.id { columnReadOnly: true }
  mutable T.Value

Remarks

The initialization of a mutable variable is not a dash assignment. At least one use of the variable must be marked with mutable in a write context such as an editable show table.

User Contributed Notes
0 notes + add a note