Datcore + meta bind plugins fo editable fields

What I’m trying to do

Hi guys, please i have an issue on Obsidian. Anyone that can help me with this?

the script i want is a Datacore table that lists all notes created in the last 7 days that have frontmatter property “noteStatus” = “new” and are in the folder “hippocampus”. In the table, I want do display the file name/link, a frontmatter property called “lifeArea” and a frontmatter property called “attention”. I want the “lifeArea” and “attention” fields to be editable.

Things I have tried

i have used only dataview and meta bind plugins for this purpose using this code below and it actually worked but now i want to do same with only datacore and meta bind:

const ONE_WEEK_MS = 1000 * 60 * 60 * 24 * 7;
const now = new Date();

// Render a Meta Bind input as inline string
function metabindText(field, path) {
  return "`INPUT[text:" + path + "#" + field + "]`";
}

dv.table(
  ["Note", "Life Area", "Attention"],
  dv.pages('"hippocampus"')
    .where(p =>
      p.noteStatus === "new" &&
      (now - p.file.ctime.toJSDate()) < ONE_WEEK_MS
    )
    .sort(p => p.file.ctime, 'desc')
    .map(p => [
      p.file.link,
      metabindText("lifeArea", p.file.path),
      metabindText("attention", p.file.path)
    ])
);

it worked with dataview and meta bind plugins but i want it to work with only datacore and meta bind plugins not using dataview, i will appreciate any help

Hi!
It’s been a while since you posted this, so I’m not sure if you’re still looking for help, but even if not maybe someone else will stumble on this and find it useful. I think this does what you’re looking for:

```datacorejsx
return function view () {
	// Week
		const ONE_WEEK_MS = 1000 * 60 * 60 * 24 * 7;
	// Now
		const now = new Date();
	// Query
	    const query = dc.useQuery('@page and path("hippocampus") and $frontmatter.notestatus.value = "new" ');
		// Filter
	    const data = query.filter(p => (now - p.$ctime.toJSDate()) < ONE_WEEK_MS);
	    
	// Column Data
		const COLUMNS = [
		    {
		        // A unique ID which identifies this specific column.
		        id: "Note",
		        // The value to show in the column.
		        value: (row) => row.$link
		    },
		    { id: "Life Area", value: (row) => `\`INPUT[text:${row.$path}#lifeArea]\`` },
		    { id: "Attention", value: (row) => `\`INPUT[text:${row.$path}#attention]\`` }
		]
			
	    // Create Table
		    return <dc.Table rows={data} columns={COLUMNS} />
};
```

Really cool way of working with your notes here! I’ll have to keep it in mind for my projects!

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