Table of Contents
Commands are the Smartness of SmartBlocks Workflows. Instead of outputting the same raw text, they are dynamic and resolve to new text. They could also perform various side effects on your graph, pull data from third party APIs, and be custom built by users.
Commands are specially formatted. It must match this syntax in order to execute in your workflow. Here is an example of a command:
<%DATE:in two weeks%>
Let's break this down into its components:
<%- Each command starts with this delimiter
DATE- The name of the command, provided in all upper case letters.
:- A colon delimiting the command name from its additional parameters. Many, but not all, commands accept additional parameters. You may omit this if the command does not.
in two weeks- The command parameters follow the command name. Unless otherwise specified, all commands use a comma (
,) to separate multiple parameters.
%>- Each command ends with this delimiter
Commands resolve in block order, in the order they appear in the block. Commands could also be nested, where some commands could serve as inputs to other commands. In this case, the nested commands resolve first, before the outer commands.
Here's an example:
<%CONCAT:<%INPUT:First name%>, <%INPUT:Last name%>%> <%CURRENTPAGENAME%>
These commands are resolved in the following order:
Command Auto Complete
<% into a block in Roam, an autocomplete menu will appear. This is to help insert commands into the graph. Clicking on one will generate a help message appearing on the bottom right of the screen with more info on what that command does.
It could get very difficult reading tons of nested commands. To help with this, you could turn on command highlighting from the
roam/js/smartblocks page. The result will give commands different nested colors to make it easier to read!
There is an active community at roamresearch.slack.com channels
#roamjs discussing and building SmartBlocks. Stop by if you need help or want to share your ideas.