Skip to content

TableRoll

The outcome of rolling on a Table.

A roll records what was rolled and what it produced: the formula, the result, and one TableRollDetail per cell of the matched row. Rolls nest — a detail whose cell referenced another table carries that table’s own rolls — so a single roll can be a tree several levels deep, which is what the rendering methods here flatten into indented text.

Unlike the other table types this is a plain Codable value, not a Realm object. It is serialized into Table/rolls for history, into Message/content for the chat log, and sent to the web client.

  • SeeAlso: Table, TableRollDetail, Message

View JSON Schema

Property Type Required Description
id string Yes The unique identifier for this roll. A UUID string generated when the roll is created, used to identify it in lists and in the chat log.
name string No The name of the table that was rolled on.
Examples: "Magic Item Table A"
formula string No The dice expression that was rolled.
Examples: "d100"; "Multiple rolls" — produced by Table/RollMode/eachRow, which rolls no dice
result integer No The rolled result that selected the row. For tables matched by position this is the one-based row number. In Table/RollMode/noRepeat it may be the row’s own value rather than the number actually rolled, when the rolled row was already taken.
details Array<TableRollDetail> No The content of the matched row, one entry per cell. The range column is excluded, since it holds the lookup key rather than content. SeeAlso: TableRollDetail
reference string (uri) No A link back to the table this roll came from. Makes the table name tappable in the chat log and lets reroll() find the table again.
Examples: "/table/6195ae04-cc85-526b-8456-56d0ab36adc2"