metadatamenu
metadatamenu copied to clipboard
Database from Lists
Hello. In dataview, it is possible to form an array from lists, and then, in the same way as from an array of notes, form a table using metadata (key::value) in them. This allows you to create a database (with a small amount of information) without creating several hundred extra notes. I would like to have the same option in the Metadata Menu.
Hi, could you give an example of such a Dataview configuration?
Good afternoon @mdelobelle Here is an example text
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and [autor:: Marc]
-
of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose [autor:: Poul]
-
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum [autor::Andrew]
-
[model::Audi] [owner::Marc] [color:: grey]
-
[model::Volvo] [owner::Poul] [color::red]
-
[model::BMW] [owner::Andrew] [color::white]
-
[model::Porsche] [owner::John] [color:blue]
-
[model::Mercedes] [owner::Marc] [color:: red]
-
[model::Opel] [owner::Andrew] [color::blue]
Code Dataview
table L.text
FROM "Dataview_list_exemple"
FLATTEN file.lists AS L
where contains(L.text, "Marc")
const MyLists = dv.pages('"Dataview_list_exemple"').flatMap(p => p.file.lists).where(p => dv.func.contains(p.owner, "Andrew"))
dv.table([ "model", "Owner", "color"], MyLists.map(b => [ b.model, b.owner, b.color]))
and a screenshot of the code results
Following the example of the second list, we can create a large database within one note, with elements containing a small amount of information.