```dataviewjs
// Assigns the page's cast entry to cast
const cast = dv.current().cast
const array = []
// Pushes each key and value pair to array
for (const [key, value] of Object.entries(cast)) {
array.push([key, value])
}
// Render table with headers and array as data
dv.table(["Character Name", "Actor Name"], array)
I totally misread the request, and there isn’t currently a proper way to get the keys of an object using a DQL query. I just read your request related to how to get to the fields within the object, cast. Sorry for misunderstanding.
You’ll need to use a query like the one provided here by @AlexTheSleepy , or you need to retype your keys, and do something like:
```dataview
TABLE WITHOUT ID character as "Character name", cast[character] as "Actor name"
FLATTEN list(
"characterA",
"characterB" ) as character
WHERE file.path = this.file.path
```
Yes, Alex’s answer is indeed the one I was looking for… I was 99% sure dataviewjs was the way to go, but I did want to know if a “pure” DQL query would be possible.
My vanilla/frontend JavaScript knowledge is not that bad, but dataviewjs is still very unknown to me, will definitely dig deeper into it.