I have a “hack” that I created to allow me to update frontmatter using dvjs and meta-bind. I store this in a file called client-menu.js that I access from a template via dv.view.
// Script to find all clients from frontmatter (2 flavours)
let clients1 = dv.pages().file.frontmatter.clients.values; // where 'clients' is populated in frontmatter YAML
clients1.unshift("ALL"); // add "ALL" option because I always want that, at top
let clients2 = dv.pages().file.where(function(b){if(Array.isArray(b.frontmatter.type)){if (b.frontmatter.type.includes("client")){return true;}}return (b.frontmatter.type == "client")? true : false;}).name; // where a note frontmatter type = 'client', had to handle empty & non-array
let uniqueclients = [...new Set([...clients1,...clients2])]; // concatenate & dedupe via a Set
let optionlist = [];
// nasty code to build meta-bind code block...but it works!
uniqueclients.forEach((currentElement)=>{optionlist.push("option(" + currentElement + ")")});
dv.paragraph("```meta-bind\nINPUT[multi_select("+optionlist+"):clients]\n```")
If anyone has a cleaner way to do this I’d love to hear it!