Roam Research Users unite!

So you're suggesting {roam-code: line1, line2, line3} would map to line1{key:enter}line2{key:enter}?

Tell me more about the indent/unindent? Are you suggesting in your example above that a "+" in roam-code would indent and a "-" would unindent?

What about this alternative syntax?

{roam-code:
line1
line2
  line3
line4
line5
}

Where Text Blaze would map something two whitespaces (or something similar) to a tab?

2 Likes

Oh, that looks far cleaner! Yes, that would be wonderful!

For the date calculator, there are a couple of use cases that would be interesting.

  • One would be to generate a random date within an interval (People like to do retrospectives to see what connections they can rekindle)
  • Another would be to enable Fuzzy dates ("two Wednesdays ago"), or "2 days later"
1 Like

Yes I agree. The tab feature would be great.

So would the multiple keyword/hashtag functions.

As far as headers and things like that, I usually just create my own shortcode.

1 Like

Hey all,

Someone reached out recently asking me about a solution for creating this kind of indentation in Roam using Text Blaze:

image

Here's how to do it:

A{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}

2 Likes

I'm not sure this answers your question about dates but check out Text Blaze's SHIFT functions, which are pretty robust. And the MMMM Do,YYYY format matches Roam's Daily Notes format. So for the example "two Wednesdays ago" you could use:

[[{time: MMMM Do, YYYY; shift=-14D>WED}]]

2 Likes

This looks like it would solve some of the problems I have with my Roam snippets as well. I have a snippet that attempts to insert the following into Roam, but I always get extra "soft carriage returns" in there which I have to delete. Having a {roam-code} option designed and tested specifically for Roam would undoubtedly help.

  • Today's tasks
    • {{[[query]]: {and: [[TODO]] {and: {[[November 11th, 2020]] } {not: {or: [[todo-nolink]] [[query]] }}}}}}}
  • Meetings
    • <blank>
  • Notes
    • <blank>

A couple other things you may be aware of but I want to mention – first, cursor positioning doesn't appear to always work in Roam. I instead have to use a lot of "uparrow" and "leftarrow" commands to position the cursor. Also, snippets that insert lines of different indent levels appear to work differently depending on the current indent level in Roam. If I start out on an unindented line, they work fine, but if I start out on an indented line, the lines inserted by the snippet do not indent relative to each other. Sorry if that's not clearly stated – I can provide details if needed.

1 Like

You inspired me to expand it to import a complete alphabetical index:

{key:ctrl-alt-1}A{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}B{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}C{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}D{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}E{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}F{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}G{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}H{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}I{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}J{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}K{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}L{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}M{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}N{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}O{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}P{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}Q{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}R{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}S{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}T{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}U{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}V{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}W{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}X{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}Y{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}Z{key:enter}{key:tab}{key:shift-enter}{key:enter}{key:shift-tab}{key:ctrl-alt-1}0-1{key:enter}{key:tab}

1 Like

Haha, cool stuff :grin:

1 Like

I have been using this for YouTube clipboard capture, however recently it started giving me a "no match found" error for the author in "Creator" - any suggestions?

{urlload: {clipboard}; done=(contents, status)->["contents"=contents, "status"=status]}{key:tab}Title:: [[{=extractregex({=contents}, "<meta name="title" content="(.+?)">")}]]{key:enter}Creator:: [[{=extractregex({=contents}, "\\"author\\":\\"(.+?)\\"")}]]{key:enter}URL:: {clipboard}{key:enter}Tags:: #Videos {key:enter}Notes::{key:enter}{key:shift-tab}

@jeff, what's the URL for a video you are trying it on and seeing the error?

https://www.youtube.com/watch?v=ItfFOpZ8no8

Hi Jeff,

I've tweaked your snippet to pull out the "https://youtube.com/" domain as {urlload} domains must now be static. In my testing this works correctly for me with your URL:

{urlload: https://youtube.com/{=extractregex({clipboard}, "^https://.?/(.)$")}; done=(contents, status)->["contents"=contents, "status"=status]}{key:tab}Title:: [[{=extractregex({=contents}, "<meta name=\"title\" content=\"(.+?)\">")}]]{key:enter}Creator:: [[{=extractregex({=contents}, "\"author\":\"(.+?)\"")}]]{key:enter}URL:: {clipboard}{key:enter}Tags:: #Videos {key:enter}Notes::{key:enter}{key:shift-tab}

Let me know if it works for you! If not, we can dig into it some more.

1 Like

This is now giving me the error for both Title and Creator

Interesting, the snippet is working fine for me with the URL. I wonder if it could be some sort of network issue.

I think it would be helpful to get on a video call with you to do some remote debugging and dig into this. Please shoot an email to scott@blaze.today and let's try to set some time up this week.

I've managed to get it working this morning! Somehow I picked up extra backslashes around the "author" portion of the snippet. When I copy and paste it changes the number of backslashes somehow. This screencap is what is working for me currently:Screen Shot 2020-12-15 at 10.52.20 AM
Thank you for your attention to this!

1 Like

Great to hear Jeff!

1 Like

Hi @cedricdebono I am experiencing the same issue, but my snippet doesn't have neither text field nor toggle nor drop down, it's a pure text and the popup still appears. The snippet is used in Intercom, another snippet with the same options it's immediately inserting the text while this one opens a popup.
Here's the snippet for visibility (used for customer support)

{import: _country}{if: country == "UK"; trim=yes}

Thank you for your patience! We have cancelled the order and you will receive a cancellation fee!
Keep in mind that it could take some time, however you should see it in your weekly statement sent on next Tuesday

Have a nice {import: _ga}!

{elseif: country == "ES"; trim=yes}{note}{import: _ett}{endnote}{if: employee=="ETT"; trim=yes}

Lamentamos lo sucedido, por favor informa de ello a tu ETT para que puedan prestarte la asistencia necesaria

{else}

Lamentamos lo sucedido, dejamos reportado al departamento correspondiente para que el pago se pueda ajustar en consecuencia.
Ten en mente que el ajuste no se ve reflejado en la aplicación, pero lo recibirás en concepto adicional en la próxima carta de pagos, que se envía todos los lunes.

Por favor, recuerda abrir un nuevo chat para próximas consultas. ¡Muchas gracias por tu colaboración!

{endif}

{elseif: country == "FR"; trim=yes}

Votre déplacement va être facturé sous forme de majoration. Il sera bien pris en compte pour votre récapitulatif de ce mardi.
Notez que si vous étiez en créneau, la majoration sera comptabilisée dans ce cadre et ne sera donc visible que si votre chiffre d'affaires généré durant ce créneau n'excède pas les minimums garantis.

Ce chat va être transféré au service en charge des paiements et ne sera plus surveillé. Merci d'ouvrir un nouveau chat pour toute nouvelle demande.

{elseif: country == "PL"; trim=yes}

Przepraszamy za niedogodności, poinformujemy odpowiedni dział, aby przeprowadzić weryfikację i w razie potrzeby skorygować płatność. W między czasie polecamy sprawdzenie artykułu Zarobki FAQ💰 . Jeśli potrzebujesz dalszego wsparcia, otwórz nowy czat. Dziękujemy bardzo!
{if: {import: _city}=="Szczecin"}{intercom-move: OPS - SZCZECIN - PL}{intercom-tag: Forward:Ops:Szczecin}
{elseif: {import: _city}=="Torun"}{intercom-move: OPS - TORUN - PL}{intercom-tag: Forward:Ops:Torun}
{elseif: {import: _city}=="Warszawa"}{intercom-move: OPS - WARSAW - PL}{intercom-tag: Forward:Ops:Warsaw}{endif}

{elseif: country == "PT"; trim=yes}

Lamentamos o sucedido! Cancelámos o pedido e irás receber o valor de cancelamento! Tem em mente que a regularização poderá levar algum tempo a refletir-se na aplicação. No entanto a mesma será visível no teu extrato semanal, enviado todos os [dia]. Para qualquer outro assunto, agradecemos que abras outro chat.
{elseif: country == "IT"; trim=yes}
Ci scusiamo per l'accaduto! Abbiamo annullato l'ordine e riceverai il relativo compenso! Tieni presente che la regolarizzazione potrebbe richiedere del tempo. Tuttavia, sarà visibile sul tuo estratto conto settimanale, inviato il prossimo giorno. Per qualsiasi altra richiesta, ti preghiamo di aprire un'altra chat.
{endif}
{intercom-send}
{intercom-tag: Payment:Rewards:HIW}

Hi @Elina_Angelowa - welcome to the forum :slight_smile:

From what I see in your snippet, you're using the {import} command to import another snippet into this one. I'm guessing the snippet you're importing, contains a drop-down menu where you would need to select the country, which in turn wouold trigger a popup.

That said, I think it would be easier to discuss this over a video call if that's convenient for you.

Please email me on cedric@blaze.today so we can find a suitable time.

In your email, kindly include your time zone and the link to this thread.

Looking forward to chatting! :slight_smile:

Hey everyone, just popping back in here because the roam tags command has been broken for a while now and I finally got around to asking about it. I used to be able to add a variable number of tags, I think with comma separation, but it was so long ago it's hard to remember. Now if I add multiple tags they get lumped together. I'm guessing this broke on Roam's end, but anyway, how would I go about changing the below snippet to allow for a variable number of keywords?

Type:: [[{formtext: name=Type; default=}]]{key: enter}{key: tab}Keywords:: {note}{formtext: name=keywords}{endnote: trim=yes}{roam-tags: {=keywords} } {key: enter}{key: shift-tab}---{key: enter}

Hi @Brandt_Weary, if you want space-separated list of tags like this {roam-tags: a b c}, then you can split the keywords to convert it to a list and then join the list items using space, like below:

Type:: [[{formtext: name=Type; default=}]]{key: enter}{key: tab}Keywords:: {note}{formtext: name=keywords}{endnote: trim=yes}{roam-tags: {=join(split(keywords, ","), " ")} } {key: enter}{key: shift-tab}---{key: enter}

If you want to add "#" before each tag then you can add an extra step to map each item to start with "#", like this:

Type:: [[{formtext: name=Type; default=}]]{key: enter}{key: tab}Keywords:: {note}{formtext: name=keywords}{endnote: trim=yes}{roam-tags: {=join(map(split(keywords, ","), k -> "#" & trim(k)), " ")} } {key: enter}{key: shift-tab}---{key: enter}

Note: You need to enter comma-separated tags in the keywords form field