Smart tags discussion thread #2513
Replies: 79 comments
-
|
I found some JavaScripts references on w3schools and modified one of the code examples on the Smart Tag help page. Now I've got a working Smart Tag for finding dates in titles. I always write dates within parenthesis, and this one will find any note that has (20 in the title, for example (2018-07-28) or (2020-10-01).
The string reference "includes" can be used to find text strings in the note text as well. Just replace "title" with "text". For example
to find any note with =Buy in the text. |
Beta Was this translation helpful? Give feedback.
-
|
Looks good! More advanced, but you can use Regex too to do more detailed date finding (because your solution won't work once we enter the year 3000 ;) |
Beta Was this translation helpful? Give feedback.
-
|
Sounds interesting, Unfortunately, I'm not a coder and know nothing of Javascript syntax. Care to give an example? I also wonder if it's possible to combine "search terms" in a smart tag, for example to find all notes that contains "=Buy" and "+Garage", or all notes that contains "=Buy" and have the tag "Home". |
Beta Was this translation helpful? Give feedback.
-
|
It's not currently possible to combine terms, but that may be an interesting addition. Ah I forgot to include a regex example in the help post. Will add this later: Regex is also supported. But be sure to escape your / and \ as necessary. |
Beta Was this translation helpful? Give feedback.
-
|
As I said, I'm not a coder. I understand that your example returns all notes with only letters, but I have a hard time figuring out how to modify the code for date formats and such. Can you recommend some good links on how to write the specific syntax for these kind of queries? What I've found so far on the web doesen't work and looks very different from your example. |
Beta Was this translation helpful? Give feedback.
-
|
Your best bet for regex is an online builder: https://regex101.com/ It's definitely not easy, but very powerful. |
Beta Was this translation helpful? Give feedback.
-
|
Perhaps not rocket science, but after some research I found (and tweaked) some regex code that will recognize the yyyy-mm-dd date format in titles. It won't check for valid dates though.
|
Beta Was this translation helpful? Give feedback.
-
|
Nice! |
Beta Was this translation helpful? Give feedback.
-
|
I found some code for making negative searches at stackoverflow.com. Perhaps someone will find it useful.
This tag will search for notes NOT containing word1, word2, or word3. It will only work for words on the first line of text, but that can probably be changed if .* is replaced or combined with some other token such as It is also possible to use symbols such as + and * as part of words, but Personally, I use _* or _+ on the first line of text to identify notes as part of themes or projects, so the smart tag I use (which will look for notes NOT marked as _+projects or _*themes) looks like this:
|
Beta Was this translation helpful? Give feedback.
-
|
Nice one guys, please consider this one, which will check for numbered lists: Could one of you please show me the way? Cheers. |
Beta Was this translation helpful? Give feedback.
-
|
Hello, ionisingTuna. I tried the following for your particular problem: |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a million. This works perfectly. |
Beta Was this translation helpful? Give feedback.
-
|
From a user email interaction: I have a tag called "Journal" that I'd like to create a view for. I've tried these 3 options with no success. I just want my 'Journal' tag to show up on the top under a "View". Solution: |
Beta Was this translation helpful? Give feedback.
-
|
Can I do text includes "todo" or "TODO" and tag includes "project1"? |
Beta Was this translation helpful? Give feedback.
-
|
Try As for a single predicate that satisfies all 3 conditions, I'm not sure. I'd have to review the code to see if that's possible. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I am trying to set up a filter which shows me notes from the current week, or last week. I don´t want to see tasks that are within the last 7 days, but rather showing all tasks I am working on this current work week (Monday through Sunday). I tried: Is there such a thing as Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
Currently it only accepts "days" and "hours", not weeks. So try "7.days.ago". Also might need to be |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your help! I will then try that. So there is currently no option for searching "within current week"? |
Beta Was this translation helpful? Give feedback.
-
|
No there is no such option. |
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone. I was wondering if it's possible to create nested / combined filters? As far as I understand the code, that would have to look something like this: However, this code shows an empty filter, even though the single filters for weekly and monthly (tags & updated_at) show the correct notes. It's the combination that does not work. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @gogolim, I don't think it's possible but I'll double-check with the dev team on this. |
Beta Was this translation helpful? Give feedback.
-
|
Compound predicates are supported, take a look at a test case here: https://github.com/standardnotes/snjs/blob/master/packages/snjs/test/lib/predicate.test.js#L260 |
Beta Was this translation helpful? Give feedback.
-
|
I could use help looking for all notes that have two tags apply. For example, I want to see everything tagged both "call" and "doToday" so I can see the list of calls I'd like to make today. The following is as far as I've gotten. !["call today", "ignored", "and", ["tags", "includes", ["title", "=", "call"]], ["tags", "includes", ["title", "=", "doToday"]]] |
Beta Was this translation helpful? Give feedback.
-
|
You'd want it to look like this: [
"call today",
"ignored",
"and",
[
["tags", "includes", ["title", "=", "call"]],
["tags", "includes", ["title", "=", "doToday"]]
]
]Flattened that would be: ["call today", "ignored", "and", [["tags", "includes", ["title", "=", "call"]],["tags", "includes", ["title", "=", "doToday"]]]]
|
Beta Was this translation helpful? Give feedback.
-
|
Hi - I'm hitting a bit of snag with this and I've had no luck with regex queries. i have 2 main parent tags (folders?) Called "Work" and "Personal" - Each have several subfolders = Such as "Personal.Example" or "Work.Example2" I like to keep things specific so nothing is tagged just "work" and all notes have more specific subtags applied. Nothing shows when looking under the work tag - I would like to make a smart tag that shows all notes with tags starting with "work" Ive tried a fair amount but nothing seems to work - At one point I had a regex running but it also picked up stuff tagged "network" which weren't work specific (Theres been more but ive lost track now!) Is what I'm trying to acheive here even possible? |
Beta Was this translation helpful? Give feedback.
-
|
With the new hierarchical folders structure, sub tags do not contain the name of their parent. So Work.Example will just be called Example, but it will have a parentId reference to the Work via its UUID. So you can't filter using name. However if you enable Preferences > Add all parent tags when adding a nested tag to a note (which is enabled by default), then adding Work.Example to a note will also add Work. In which case the filters will work. Last option would be to create a filter based on the parentId of the tag. But I haven't really tested this before. Something like |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for this, how would i find a tags UUID? |
Beta Was this translation helpful? Give feedback.
-
|
Probably the easiest (but somewhat cumbersome) way to do this would be to export a decrypted backup file of your account data, search for the tag name, and find its uuid. We'll work on adding the tag uuid to the right click context menu, similar to what we do for notes. |
Beta Was this translation helpful? Give feedback.
-
|
How do I create a Smart View for a tag using the Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @StuartMorrisAU, unfortunately the builder isn't able to make that particular smart view just yet, but the Custom JSON creator has a sample which should help you do this: You just need to replace the names in the value property with your desired tag names! |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Creating a dedicated thread for any questions related to Smart Tags. Feel free to share any tags you've created, or ask for help on how to construct a custom query.
Beta Was this translation helpful? Give feedback.
All reactions