Formula field in Metadata Menu not working for array calculation

Problem: The Formula field in Metadata Menu is not returning the expected array of values, although simple calculations work fine.

Context:

  • Using Obsidian with Metadata Menu and Bases plugins
  • Want to track article publication status across different platforms

Setup:

  • Field published: Multi-select field with platforms (works correctly)
  • Field not_published: Formula field to calculate remaining platforms

Article frontmatter:

---
title: "Test Article"
published: ["Facebook", "LinkedIn"]
---

Formula code for not_published:

const allPlatforms = ["Facebook", "LinkedIn", "Medium", "Substack", "Reddit"];
const published = this.published || [];
return allPlatforms.filter(platform => !published.includes(platform));

Expected result: ["Medium", "Substack", "Reddit"]

What works:

  • Simple formulas like return 10 + 10 return 20
  • published field displays and edits correctly
  • Bases table shows data from frontmatter properly

What doesn’t work:

  • Formula field not_published doesn’t show the calculated array
  • Returns empty value or error

What I’ve tried:

  1. Different formula syntax variations
  2. Data type checks (Array.isArray(this.published))
  3. Simple test arrays (return ["test1", "test2"])
  4. Restarting Obsidian and plugins

Versions:

  • Obsidian: v1.9.12
  • Metadata Menu: v0.8.9

Question:
What could be causing the Formula field to not return an array when simple calculations work? Are there any known limitations or specific syntax for working with arrays in Formula fields?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.