Table from inline Key::Value

Question

I have a list of apps in a note, with in-line key:: values

How can I use dataview to achieve a table similar to this?

apps cost
Homerow… free
keybaord… paid
figr.app free

What I have tried with no joy (and about a million similar combinations).

TABLE rows.file.lists.text as "apps", cost
from ([[]])

Thank you

I’ve got three queries for you, all based on the same idea, but with slight variations. The first concept however is that you need to FLATTEN the list to get to each item on its own, and to lock this to the current file you’d use something like:

FLATTEN file.lists as item
WHERE file.name = this.file.name

With the data produces as I’m assuming to be as follows:

- https://www.google.com [cost:: free]
- https://www.algolia.com [cost:: premium]

You can do either of these queries:

```dataview
TABLE WITHOUT ID item.text as Website, item.cost as Cost
FLATTEN file.lists as item
WHERE file.name = this.file.name
```

```dataview
TABLE WITHOUT ID regexreplace(item.text, "\(.*?\)", "") as Website, item.cost as Cost
FLATTEN file.lists as item
WHERE file.name = this.file.name
```

Which respectively produces the following output:

image

Or you could possibly alter the input data slightly, and do something like:

- (url:: https://www.google.com) (cost:: free)
- (url:: https://www.algolia.com) (cost:: premium)

```dataview
TABLE WITHOUT ID item.url as URL, item.cost as Cost
FLATTEN file.lists as item
WHERE file.name = this.file.name
```

And get this output:
image

At least if you style the inline fields a little to be like normal text, and using the hidden inline field syntax.

Thank you so much for the help

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