Lesson 5: How to Power Your Workflows Using Properties and Dynamic Variables

So basically (page-property ... ...) equals to “list blocks that are on pages with this page property”.


But what is this supposed to return?


Logseq creates pages from properties names, not values. Maybe you are confusing the two? Otherwise maybe I didn’t get what you mean.

1 Like

Hi Alex,
This returns blocks with link [[sbp1]] and their children on pages with page-property SomePageProperty:: spp1.
The block link can be either a property with a linked value or just a link/tag.

Thanks for the clarification about “:property-pages/enabled? false”. I was confusing property names with values. Now I will have to consider the consequences of not automatically having a page for each property name.

1 Like

I think very few people who read this

will understand it like this:

Might need clarification there.

2 Likes

{{query ... (page-property ... ) ...
will return pages with specified page property

{{query ... (property ... ) ...
will return blocks with specified property

{{query [[link]]}}
return blocks with [[link]] and children of those blocks. (and of course the page with name Link and all blocks in that page). This is the only valid inheritance rule.

These queries
{{query (operator (page-property ...) (property ...) }}
{{query (operator (page-property ...) [[link]]}}
should return error, it’s basically type error, trying to group pages and blocks together

And it does return error for me.

1 Like

Thank you for pointing this out, as the lesson is indeed incorrect. Sorry for the confusion, but I also had a wrong understanding of how block properties work.

I’ve now updated the property section.

Thanks. Getting clearer every day.

I can not confirm the error you mention when combining properties and page-properties.

I’m on Logseq 0.8.4

block properties are not applied to their entire branch

It is also like this in org-mode and, there too, for performance reasons. Tags (links in Logseq) are inherited while properties aren’t.

@Ramses it confuses me that you say that sort-by is just for pages because only pages have creation and modification dates. But AFAICU sort-by may be used in order to sort by other properties, so why would it just work on pages?

I’ve learned that later as well, but I wasn’t aware of that at the time of writing these lessons.

However, the way sort-by is used in the course is by sorting on dates. The thing is, only pages have the date properties (blocks don’t at the moment, due to performance issues). That’s why I said they only work in combination with pages. When I run another cohort of this course, I’ll probably show how to use sort-by in combination with other properties.

2 Likes

how do you make that timestamp?

Type / to open the command palette and start to write “timestamp” for autocompletition

3 Likes

Thank you,
what a great feature.

2 Likes

I found a bug here. If I do sort-by with a property whose value is a journal page, it will not sort by the journal date. With advanced queries it does work, but I wish I didn’t have to resort to that.

Question:
(sort-by created-at asc)

how to implement the sorting in the advanced queries?

Hey @Federico_Frosini, that’s outside the scope of this course as it’s about simple queries only.

If you have a question about advanced queries, I recommend you search the forum or otherwise create a new thread/post in #questions-and-help and give it a clear, descriptive title. That way, your question is much more likely to be seen and receive answers.

Hi all, first of all thanks for the documentation! I just wanna mention that the first link in this article - “As per the official documentation” is currently invalid. I assume that the page you intended to link to was Properties (logseq.com).

1 Like

Thank you, I have updated the post.

This is very confusing. I have spent 10 minutes completely confused with my logseq database, trying to see some results while typing these. The problem is, I failed to catch any query with page-property in it. Is it still in logseq, or has it been deprecated since??

Still works.
If you use the live query builder and first select pages at the top right, then page property you should get a list of page properties you have in use.
If that list is empty, then you have not yet (properly) defined any and so queries will not return results.

2 Likes

ah, then, that was it. I was not aware of that distinction on the top right that I had to pick “page property” specifically.

1 Like