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 + 10return20 publishedfield displays and edits correctly- Bases table shows data from frontmatter properly
What doesn’t work:
- Formula field
not_publisheddoesn’t show the calculated array - Returns empty value or error
What I’ve tried:
- Different formula syntax variations
- Data type checks (
Array.isArray(this.published)) - Simple test arrays (
return ["test1", "test2"]) - 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?