As Planarly uses a tree structure to organize sheets — a hierarchical model where sheets can contain child sheets, much like folders can contain folders on a file system — it provides a dedicated syntax to reference cells and regions in other sheets.
Planarly's tree structure starts at Root
. This is the highest or outermost level of the sheet hierarchy. In the example below you can see that the document contains two top level sheets, sheet1
and sheet2
. sheet2
has two child sheets, child1
and child2
. child2
is selected for editing.
To reference the cell labelled foo
in the sheet child2
, the absolute path would be:
Root.sheet2.child2.foo
If a sheet title contains spaces, simply enclose it in double quotes:
Root.taxes."income taxes".total
When building re-usable libraries of code within Planarly there is no way to know in advance where the sheets will be located. As a result, using absolute paths to reference other library functions isn't feasible, so Planarly provides a simple method for specifying relative paths.
These are based around the reserved symbols P
, PP
, PPP
, etc. P
is short for parent, i.e. the sheet containing the current sheet. Thus PP
refers to the parent two levels up, PPP
the parent three levels up, etc.
Referring to the image above, referring to foo
in child2
from child1
would use the following relative path:
P.child2.foo
In the example below we show how values from another sheet can be accessed within a re-usable collection of code under a single parent sheet, here ufo tech
.
@
operatorIf you use informative naming conventions accessing values from other sheets can result in long formulas and a lot of typing. Planarly has the @
operator to set the sheet context for interpreting variable names.
a+b @ P.a
evaluates a+b
in the context of sibling sheet a
. The @
operator has the lowest precedence, so you can write almost anything on the left hand side without using ()
.