obsidian-dataview icon indicating copy to clipboard operation
obsidian-dataview copied to clipboard

Add new page from table view

Open arminta7 opened this issue 3 years ago • 6 comments

I would love to be able to add new page from the table view and to have a pre-filled yaml structure (so the page fits the query). Perhaps even be able to define default yaml values?

Thoughts?

arminta7 avatar Mar 21 '21 00:03 arminta7

I think this is a great idea! It would be an easier way of inserting a template into a new note.

If a note had, say, 10 fields in its metadata, but the dataview table block only references 3 of those 10, would the newly created note only have those 3 inserted into it? I guess that makes the most sense, as the other 7 may not be consistent across the notes. Thoughts?

SkepticMystic avatar Mar 21 '21 06:03 SkepticMystic

Yes, I agree that it probably makes the most sense to add the 3 fields that are common across all of the notes.

arminta7 avatar Mar 21 '21 06:03 arminta7

I like the UX of this, and dataview has been a little... lacking in the frontend department, haha. It will be a little difficult for complex sources (what do I do if there is an 'OR' in the query?), but I can implement this for simple cases. Maybe I can add a TEMPLATE command which lets you specify a template to copy?

blacksmithgu avatar Mar 23 '21 23:03 blacksmithgu

I think a template is a great idea! Perhaps being able to set default values for fields in the template could help with the more complex queries?

arminta7 avatar Mar 24 '21 00:03 arminta7

For more complex queries, taking the intersection of the fields would guarantee all returned results have that field.

More specifically, take the intersection of the arrays of keys in each note

SkepticMystic avatar Mar 24 '21 04:03 SkepticMystic

I think some newer plugins like obsidian-notion-like-tables do this. Check #1015 for further discussion.

AB1908 avatar Jul 25 '22 12:07 AB1908