I want to have a list key values for 1 particular property. The amateurish way of doing this would be to write for example type:: and then a dropdown list with all the existing key values for that property is presented.
Is there a query to get the results in a table? I tried this {{query (property type *)}}, thinking that perhaps the * indicates all instances, but it does not, Logseq probably interprets it as having to find a property called *.
The query finds the lines that have the property specified in the syntax, then lists them as output. In certain lines there will be more than 1 value, or different value combinations.
So, there may be a line with type:: value1, value2 and another line with type:: value1, value3, value7. Or there is type:: value1, value2, [[value6]] - the double brackets are added automatically because of the Automatic Linker plug-in, I think.
What you see now is a list of actual values. Where value1, value2 is the value in this case. Instead of the property having 2 values. Namely value1 and value2.
It would be 2 values if the config option to consider comma separation as separate pages is on for this property.
It would then be stored as a set. #{"value1" "value2"}
In theory those can then be separated out. Unfortunately this is not something I know how to do.
In config.edn I have made the amendment to :property/separated-by-commas #{:topic}, since it is the property topic I am exploring this with. But I don’t see those sets you mention.
In any case, it does not matter because you don’t know how to do the separation afterwards. It is not a big deal because the list as it is now already provides me with what I need in essence.
It’s because we get :block/properties-text-values and not :block/properties.
And we then do some fancy :view things.
Remove that and you should see it.
Pro-tip: if you turn on developer mode you can right click a block and select show block data. This shows what is stored in Logseq’s internal database and so what can be retrieved using queries.
Learn Clojure?
I’ve been wanting something similar and I haven’t figured out how to tell the program to do what I want.
I just wanted to show that it is stored as separate values so it should be possible to extract them.
I’m just not that savvy in programming.
Empty line might be empty value? Maybe in a template or other place where this property doesn’t have anything filled in. (property:: )