Open TfTHacker opened 3 years ago
#42SmartBlock 0 Use tag in block as parameter for other command
<%J:```javascript var refName = null;
//Test for #tags var startingBlock = document.activeElement.value.match(/(#)([A-Za-z0-0]+)/); if(startingBlock) { refName = startingBlock[2]; } else { startingBlock = document.activeElement.value.match(/([[)(.+)(]])/) if(startingBlock) refName = startingBlock[2]; }
if(refName) roam42.smartBlocks.activeWorkflow.vars["refName"] = refName; else roam42.smartBlocks.activeWorkflow.vars["refName"] = '0';
return ' ';```%>
- ```` <%IFTRUE:"<%GET:refName%>"!="0"%><%BLOCKMENTIONS:10,<%GET:refName%>%>
Retrieves a tag or page reference and feeds it into anothr command Video demonstration:
https://www.loom.com/share/dfdb2922890349d887bd7a2e95851334
✂️ Copy of your #42SmartBlock from Roam
//Test for #tags var startingBlock = document.activeElement.value.match(/(#)([A-Za-z0-0]+)/); if(startingBlock) { refName = startingBlock[2]; } else { startingBlock = document.activeElement.value.match(/([[)(.+)(]])/) if(startingBlock) refName = startingBlock[2];
}
if(refName) roam42.smartBlocks.activeWorkflow.vars["refName"] = refName; else roam42.smartBlocks.activeWorkflow.vars["refName"] = '0';
return ' ';```%>
📋 Describe the SmartBlock
Retrieves a tag or page reference and feeds it into anothr command Video demonstration:
https://www.loom.com/share/dfdb2922890349d887bd7a2e95851334
📷 Screenshot of your #42SmartBlock workflow/template from Roam