SmartBlocks icon indicating copy to clipboard operation
SmartBlocks copied to clipboard

Delete a page and re-create it

Open GitMurf opened this issue 5 years ago • 0 comments

✂️ Copy of your #42SmartBlock from Roam

  • #42SmartBlock Delete page and re-create
    
    • <%JA:
      ```javascript
      var nameOfPage = 'Daily Agenda';
      var pageTitleId = await roam42.common.getPageUidByTitle(nameOfPage);
      await roam42.common.deletePage(pageTitleId);
      await roam42.common.createPage(nameOfPage);
      return '';```
      %>
      

📋 Describe the SmartBlock

USE AT YOUR OWN RISK! THE DELETE ACTION CANNOT BE UNDONE!

This SmartBlock deletes a page based off the name you provide in the first line of the code. It then re-creates the page for you right after. Effectively it cleans up a page, all its blocks and backlinks, and then re-creates one "fresh" to start over from.

✅ Describe any prerequisites or dependencies that are required for this SmartBlock

roam42

📷 Screenshot of your #42SmartBlock workflow/template from Roam

image

GitMurf avatar Feb 25 '21 00:02 GitMurf