Is there a way to get a count of Tags in the filter section?


#1

I am working to create a dashboard of my tags and counts would be helpful.

Thanks in advance.


#2

You mean “how many tags do I have”, or “how many drafts are assigned to this tag”? Both are sort of possible, but not in very efficient ways. Definitely an area that needs some improvement on the scripting side.


#3

Thanks for the response. The latter - I am interested in how many drafts are assigned to this tag?


#4

You would have to do it by the Draft.query method (docs) per tag. To count drafts with the tag “blue” in the inbox:

let ct = Draft.query("", "inbox", ["blue"]).length;