Style and viewer functions
Every function in this family, with its signature and examples. Each example runs as a test of the language. See Language basics for how calls, types, and operators work.
setStyle
Sets one style key on one field of the current row; a later write of the same key on the same field wins. Chains with .setStyle() and .setRowStyle().
setStyle(field, key, value)
style.setStyle(field, key, value)
Also callable as receiver.setStyle(…), with the receiver as the first argument. Statement position only.
if(test(prop("Fund ID"), "14$"), setStyle("Fund ID", "background", "lime")): Fund ID cells that end in 14 get a lime backgroundsetStyle("Reporting GP", "icon", "thumbsup").setStyle("Reporting GP", "text_color", "indigo"): Every Reporting GP cell shows the thumbsup icon in indigo text
setRowStyle
Sets one style key on the current row itself, with the keys setStyle takes; the row's text styles reach every field that does not set that key itself.
setRowStyle(key, value)
style.setRowStyle(key, value)
Also callable as receiver.setRowStyle(…), with the receiver as the first argument. Statement position only.
if(prop("Done"), setRowStyle("strikethrough", true).setRowStyle("text_color", "gray")): Done rows are struck through in gray
clearStyle
Removes one style key from one field of the current row, or every style key on it when no key is given. Chains like setStyle.
clearStyle(field)
clearStyle(field, key)
style.clearStyle(field, key)
Also callable as receiver.clearStyle(…), with the receiver as the first argument. Statement position only.
if(prop("Settled"), clearStyle("Settlement Date")): A settled row keeps no style on its Settlement Date cellclearStyle("Notional", "background"): The Notional cell loses its background and keeps its other styles
clearRowStyle
Removes one style key from the current row itself, or every style key on the row when no key is given. Chains like setRowStyle.
clearRowStyle()
clearRowStyle(key)
style.clearRowStyle(key)
Also callable as receiver.clearRowStyle(…), with the receiver as the first argument. Statement position only.
if(prop("Status") == "Confirmed", clearRowStyle()): A confirmed trade's row carries no row style
me
Returns the signed-in viewer's name, or empty where the view has no signed-in viewer.
me() → text
View formulas only.
if(prop("Assignee").includes(me()), setRowStyle("background", "sky")): Rows assigned to the viewer get a sky background
optionColor
Returns the colour token of the option the current row holds in a select, status or multi-select field (the first selected option that has a colour), or empty when it has none. The field is a text literal.
optionColor(field: text) → text
View formulas only.
setStyle("Status", "dot", optionColor("Status")): Each Status cell shows a dot in its option's colour; an option without a colour shows none