Skip to content

[BUG] getFieldValues not filtering correctly when tags are specified in options under certain conditions #927

@stecydube

Description

@stecydube

Tried the getFieldValues in a dataviewjs block, specified one tag but got no results.

To Reproduce

Steps to reproduce the behavior in Obsidian:

  1. Open Obsidian
  2. Have DataView also installed
  3. Create a test note, see below for example #1
  4. Important: Note must have the tag in the frontmatter. The field must be a dataview field outside the frontmatter.
  5. Modify the note as per example #2
  6. Now with the tag outside the frontmatter it works

Example #1:

---
aliases:
cssclasses:
tags:
  - Test
---
Id:: Value

```dataviewjs
const quickAddApi = this.app.plugins.plugins.quickadd.api;
const values = await quickAddApi.fieldSuggestions.getFieldValues("Id",
    { 
        tags: ["Test"],
        includeInline: true 
    });
console.log(values); // Output is []
```

Example #2:

---
aliases:
cssclasses:
tags:
---
#Test
Id:: Value

```dataviewjs
const quickAddApi = this.app.plugins.plugins.quickadd.api;
const values = await quickAddApi.fieldSuggestions.getFieldValues("Id",
    { 
        tags: ["Test"],
        includeInline: true 
    });
console.log(values); // Output is ['Value']
```

Expected behavior

getFieldValues should work with tags from the frontmatter.

Obsidian Debug Info (required for bug reports)

SYSTEM INFO:
	Obsidian version: v1.9.12
	Installer version: v1.9.12
	Operating system: Windows 11 Pro 10.0.26100
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: dark
	Community theme: ITS Theme v1.3.40
	Snippets enabled: 2
	Restricted mode: off
	Plugins installed: 53
	Plugins enabled: 50
		1: Dataview v0.5.68
		2: Natural Language Dates v0.6.2
		3: Hover Editor v0.11.26
		4: Periodic Notes v0.0.17
		5: Calendar v1.5.10
		6: Templater v2.15.2
		7: Columns v1.6.1
		8: Admonition v10.3.2
		9: CustomJS v1.0.21
		10: Advanced Tables v0.22.1
		11: QuickAdd v2.4.0
		12: Tasks v7.21.0
		13: Commander v0.5.4
		14: MetaEdit v1.8.2
		15: Plugin Update Tracker v1.7.0
		16: Minimal Theme Settings v8.1.1
		17: Find orphaned files and broken links v1.10.1
		18: Excalidraw v2.15.3
		19: Linter v1.30.0
		20: Git v2.35.0
		21: Version History Diff v2.3.3
		22: Buttons v0.9.13
		23: Core Search Assistant v0.9.4
		24: Emoji Toolbar v0.4.1
		25: Hotkey Helper v0.3.20
		26: Keyboard Analyzer v0.4.1
		27: Links v1.17.47
		28: List Callouts v1.2.9
		29: Sheets Extended v1.2.10
		30: MySnippets v1.2.3
		31: Pane Relief v0.5.9
		32: Quick Switcher++ v5.3.1
		33: Recent Files v1.7.4
		34: Settings Search v1.3.10
		35: Show Current File Path v0.5.2
		36: Tag Wrangler v0.6.4
		37: CSV Codeblock v1.1.0
		38: Homepage v4.2.2
		39: Iconize v2.14.7
		40: CSS Editor v1.10.2
		41: Style Settings v1.0.9
		42: Supercharged Links v0.13.6
		43: Workspaces Plus v0.3.3
		44: Image Zoom & Drag v6.1.1
		45: Open Sidebar on Hover v1.0.2
		46: Enhanced Symbols Prettifier v1.4.3
		47: Codeblock Customizer v1.3.1
		48: Modal forms v1.61.0
		49: Meta Bind v1.4.6
		50: Vertical Tabs v0.16.4

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Environment:

  • Obsidian version: See debug output
  • QuickAdd version: See debug output
  • Operating system: See debug output
  • Debug info: See comment in each example
  • Other plugins enabled: See debug output
  • Theme: See debug output

Console Logs

See comment in each example

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions