Docs

Variables for reusable dynamic documents

Define variables such as Collaborator, Area or Date on a dynamic document and bind query block filters to them, so one layout renders for whatever the reader picks.

A variable is an input on a document. Instead of building a day sheet for every collaborator, you add a Collaborator variable, bind the query blocks' filters to it, and the document shows whichever collaborator the reader picks.


Adding a Variable

Open Variables

In the document editor, click Variables in the top bar.

Add one

Click Add variable.

Set it up

Give it a Name the reader will see, such as "Collaborator" or "Show Date", choose its Type, and set Allow multiple values, Required and a Default value as needed.


Variable Types

TypeThe reader picks
CollaboratorA collaborator on the event
AreaAn area on the event
ActivityAn activity on the event
CrewA crew member on the event
ResourceTypeA resource type
DateA date
TextFree text

With Allow multiple values, the reader can pick several, for example every area a department head looks after. A filter bound to a multi-value variable with is matches any of the picked values, and with is not excludes all of them.


Binding a Filter

In a query block filter, click the pin in the value field and choose Use variable, then the variable. From then on the filter uses whatever the reader has picked.


Picking Values

In the editor and on public links, a document with variables shows a Variables bar at the top. Readers pick a value for each one, and every block bound to it reloads. Documents opened from a collaborator's Dynamic Docs tab have no bar and use each variable's default value, so set defaults on documents you share that way.

What happens before a value is picked depends on the variable:

  • With a Default value, the document opens already showing that value.
  • A Required variable with no value and no default leaves the blocks that use it empty, and an error message names the missing variable, until a value is picked.
  • An optional variable with no value is ignored: filters bound to it are skipped, so the blocks show all their rows.

Set a default on required variables so the document opens on the most common case. Deleting a variable leaves its filters in place but skips them.