SMARTBLOCKS: DEVELOPER DOCS
Table of contents
activeWorkflow contains information about the current workflow being run. When the next workflow begins, all values in this object are reset to null except for roam42.smartBlocks.activeWorkflow.vars.
As a convenience, there is a short version of this object called roam42.sb which can make code less verbose.
This is a shared variable storage for workflows. GET and SET read variables from this object, which is an associative array. Example:
<%SET:MyVar,MyValue%> can be retrieved with:
roam42.smartBlocks.activeWorkflow.vars["MyVar"] = "NewValue";
Note: the vars object does not persist, use localStorage from the browser if you need persistence
Contains the name of the currently (or last run) workflow
Contains the parent block reference UID of the workflow that currently (or last run)
The HTML element ID of the block from which the workflow was started
The text of the block from which the workflow was started
Contains text from the current block in the workflow before being processed (useful if you want to see the context of the entire block)
the HTML Element ID of current point of where the workflow is going to insert text at finish
If focus command was used, this contains the HTML Element ID of the block that will be focused upon completion
Call this command to output additional blocks after the current block finishes. This can be called multiple times to output multiple blocks
outputBlock - string of text to be inserted into the next block
There is an active community at roamresearch.slack.com channels
#roam-js. Stop by if you need help or want to share your ideas.
End of SmartBlock information