Query specific Items from a specific list

Hello,

I have a list something like this.

# Correspondence
- some text [email-from:: [email protected]]
- some text [email-to:: [email protected]]

and a query like this

TABLE L.text 
FLATTEN file.lists as L 
WHERE meta(L.section).subpath = "Correspondence" AND email-from = "[email protected]" 

regardless of what I use as an AND, it pulls all items from the Correspondence list. is there any way to only pull the specific list items with [email-from:: [email protected]]? It seems like it should be possible because when I run $=dv.span(dv.current()) I get something like

- lists
-- text: some text
-- email-from: [email protected]

maybe something like this?

TABLE L.section AS "Section", L.text AS "email-from"
FLATTEN file.lists AS L
WHERE meta(L.section).subpath = "Correspondence"
WHERE contains(L.email-from, "[email protected]")

I got this output

2 Likes

Perfect, thank you!

Even after you’ve flattened the lists in its natural is usually available, so you’ll need to referring to the specific flattened version so as not trigger multiple positive responses like you did in your first query.

I’m not sure what you mean. Can you provide an example?

In your original query you used email-from which was available in the page scope, even though you already had flattened file.lists into L. So now for each L you’d still have positive matches on the page scoped email-from, instead of picking out the one L.email-from which had that specific instance you was looking for.

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