Create Properties from inline text as I type and make them available as variables inside the block

Hi guys, I am quite tired of “quick capturing” ideas that is not that quick anymore, since I started to use block properties and I have to duplicate data that I already filled inside the block into a property value. I want to be able to just write text and properties to be created for the block as I type. I am thinking at a sort of hint in the text that would tell Logseq that the following will be a property and its value. It’s maybe the same :: that would be recognized even if not written on an empty line but inside the text somewhere. It should prompt me to type a property name or select one from the list (exactly as it’s currently done when on an empty line) and then when entering the value, it should place that value in both the properties section of the block as well as leave it in the text.

Additionally, once created, these values should be available as variable values if I need to refer at their value again in the text.So if a property book-title:: was created using the above method, if I need to mention again, in the same block, the book title, I would just type $ and I would get a list of matches from the block properties with every new character that I type, so I can ultimately get a $book-title that would get replaced with the value after I press another space to continue writing.

This should immensely speed up the Quick Capture of data, as a Journaling/PKM app should.

See Syntax for inline properties::.

1 Like

I saw that before, I even upvoted it. How is my proposal the same with that!? This proposal I am making is something else almost entirely as it uses the exact same mechanism that is already in place for filling properties (start by typing ::, then choose from the list or type a new property name, hit enter, input the property value) but make it be possible to be triggered anywhere in the text, not just on empty lines like it is implemented currently. That slight change (trigger property creation not only at the beginning of an empty line but anywhere in the text when double colon is encountered) plus “leave the value in the text” would not necessitate a lot of changing of the current way of doing things. Plus the text would be much cleaner.

I see @Alex0 's proposal as complementary to this one so that external tools can edit the markdown files and still Logseq would be able to pull-in properties from that syntax.

The creation of Block-Variables from the Block-Properties is maybe a separate Feature-Request but is so common sense that I shouldn’t need to mention it really but, as long as it’s not implemented in Logseq, have to.

@FlorianF do you want $key to be replaced by value if a block has a key:: value property, to keep the text cleaner compared to my inline properties?

I am not proposing an alternative to your solution, which I find valuable for getting properties into Logseq database if the Markdown files are edited by external tools, in which case Logseq needs to recognize that certain syntax must be pulled as properties, but I suggest a method for having a Quick Capture of Data together with at the same time creating the properties within the existing UI method.

With my Proposal:

  • I type text
    • within that text I type :: (can it get simpler than that? moreover, it’s within the existing code’s realm)
      • I get the usual Create Key or Select from List existing key
        • I create or select and press Enter => key:: is added to the properties section of the block
          • I type whatever value => value is added both inline and to the key:: property at the same time (as I type) until I press ex Enter (or :: again)
            • I type on my idea into the block until I maybe need to reuse the key:: value, in which case I don’t need to type again the value but I can call it by $key … and I continue typing (as $key is replaced with the value of the key::` property)

I see this idea valuable for [existing UI/Edit Mode] Quick Capture IF the properties would be allowed to be written anywhere in the text instead of on their own line.

@FlorianF so you want a keyboard shortcut to add a property to the current block?

Have you thought about setting your OS so that a keyboard shortcut produces the following input: End, Enter, ::, ←← ?

This would trigger the property key autocompletition, but once done you have to move the cursor back where you were writing manually.

:: already triggers the “create new or select existing property” function, I just need it to be available anywhere in the block’s text, not only at the beginning of a line.

I want quick capture of my ideas/etc so that I don’t spend too much time setting up my system. I simply want properties to be created as I type whatever I have to input in my system. Of course I can create the property manually the usual way, copy/paste it’s value and reuse it inside the body of the block if needed. But that only increases friction and I might as well never use properties, in which case I loose all the fun with queries and table outputs.

The proposed workflow is not so far away from what we already have.

Check also Inline properties and reuse of property values, basic implementation