I'm trying to filter an org mode heading by tag in a dynamic block, but the match syntax is not quite working out.



* Something                                                       :work:home:
* Other thing                                                          :home:

#+BEGIN: columnview :id global :match "TAGS=\"work\""
| ITEM        | TAGS        |
| Something   | :work:home: |
| Other thing | :home:      |
#+END: columnview

The :match "TAGS=\"work\"" query returns all headings. How to fix the query so only the headings tagged with work are displayed in the dynamic block?

  • same problem; any progress/info? Mar 9 '20 at 11:54
  • @user2583621 nope, I could not figure it out...
    – Thales MG
    Mar 9 '20 at 18:19

Try :match "work". IIRC, match already takes care of the "TAGS=\" stuff.

  • Nope, it produces the same result (both headings are returned).
    – Thales MG
    Mar 24 '20 at 12:02
  • OK, I'm not an expert, but I have this working on my machine. I have removed columnview from my #+END: form though, so it just reads #+END:. That, in conjunction with `:match "work" are the only differences between my test file and what you've posted in the OP. Did that help?
    – mathemacs
    Mar 25 '20 at 3:33
  • Nope, still does not work for me with the given example. Both headings are listed.
    – Thales MG
    Apr 24 '20 at 10:46

I had the same issue using org-mode 9.0.1. After updating to 9.3.7, it works like a charm. Comparing source code of org-colview.el, it showed that my org-mode version didn't have the match argument. Maybe updating would solve your issue as well? (It seems to me your query syntax is correct.)


As Paul van Geber said, there was an update to Org-mode that seems to have resolved this issue. I just had to make a slight change in the way my match query was being made.

If I want just the items tagged work, I have to do:

#+BEGIN: columnview :id global :match "work"

... and then run org-update-all-blocks.

If I use TAGS=, I have to match all tags, apparently. For instance, to match the first item in my original example, I need to do:

#+BEGIN: columnview :id global :match "TAGS=\":work:home:\""

... and again org-update-all-dblocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.