Queries Obsidian’s built-in search and returns the file paths of the notes found. See https://help.obsidian.md/Plugins/Search for syntax.
Use the “Get Note” action with the returned file paths to get the actual note contents.
There’s currently no good way to programmatically search a vault, and many developers opt to run a search in Obsidian, as you yourself would, and then scrape the results list. This is a brittle process, to say the least, and not working well on iOS, so this action isn’t available on iOS.
It is recommended to use the “Search Notes With Omnisearch” action for searching via the Omnisearch plugin (if installed) which works on both platforms.
Parameters
Vault
The vault to work in.
Type: Vault reference
Search query
The search term.
The query is passed to Obsidian as-is, so any search terms available in Obsidian’s search can be used. See https://help.obsidian.md/Plugins/Search for details.
Type: Text
Return Value
Text (list)
Examples
Most of the time you would use this action to get a list of search results (their file paths), then loop over the results list using the built-in “Repeat With” block. If you want to retrieve the details of the notes, you would use a Get Note action and use the loop variable Repeat Item
as the argument for its “File Path” parameter.
![Screenshot of the action](/_astro/afo-search-notes.DVdRDiSe_Z221VQr.webp)
If you want to filter the list by folders etc., I recommend using the “Filter List” action from Sindre Sorhus’s excellent Actions app (no relation) or a built-in “Repeat With” loop with a contained “If” action.
Related Links
- Search the Actions for Obsidian community forum for "Search Notes"