dvargas92495 / SmartBlocks

Useful examples from developer community for Roam42 SmartBlocks
147 stars 7 forks source link

SmartBlock commands to read and write variable pairs from/to a roam42/sb/variables page for persistence #93

Open eatondpe opened 3 years ago

eatondpe commented 3 years ago

📋 Describe the new feature/idea/enhancement you are requesting

<%WRITEVAR:var%> would write var:value in the user's roam42/sb/variables page.

<%READVAR:var%> would read the value of var from the var:value block in the user's roam42/sb/variables page.

🔑 Why do you want this?

This would allow variables to persist across sessions and devices.

This would allow counters, for example, to maintain state across sessions and devices.

⚠️ Is your feature request related to a problem? Please describe.

No.

🔨 Describe any alternatives you've considered

  1. Javascript to do something similar.

  2. Using a #roam42SBvars tag so that the SmartBlock could write to whatever page the user is running the SmartBlock on and still allow <%READVAR:var%> to discover it. In this case, selecting the most recent var:value block would be required.

💻 Environment

Platform:

Browser:

📷 Additional Info (Screenshots, GIFs, etc.)