Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to get repeating key:: values as a list? #222

Closed
rishifter opened this issue May 14, 2021 · 11 comments
Closed

Is it possible to get repeating key:: values as a list? #222

rishifter opened this issue May 14, 2021 · 11 comments

Comments

@rishifter
Copy link

@rishifter rishifter commented May 14, 2021

I'm using inline tags as key:: value to track list of things I watch in my dailies, something like #watched:: School of Rock. However, if there are multiple things I've watched on the same day, there are multiple such entries in the same file and my Watched log only picks up the last one. I understand that this works like a variable assignment overriding the previous values. Is there some way to aggregate the values together and extract an array or list if the same key has multiple values within the same file?

@blacksmithgu
Copy link
Owner

@blacksmithgu blacksmithgu commented May 15, 2021

Sure, seems reasonable - will add to the next release.

@jaroet
Copy link

@jaroet jaroet commented May 20, 2021

Specially the list or table view would be great in this regards. An array is not much use in my use-case.
In my daily file I note down short contactmoments during the day. A meetings will get a page itselves but short phonecalls or Slack discussions I will summarize in a daily note.

Something like this :

subject:: Talked to [[John]] about [[project A]] and we decided to postpone initial release for 1 week.

On some days I will have 10 or more "subjects:: " in 1 daily file.

I would like to add a query to the pages [[John]] and [[project A]] so I can see in one glance all the communication/decisions (subjects::) I had with John or about project A.

Currently that does not work using dataview, I use the regular ```query for that, but dataview is way nicer in formatting and also offers more features like extra filtering or limiting the number of results.

So this would be extremely helpfull for my workflow ... but less so when in an array.

Thanks ...

@jonathanjo
Copy link

@jonathanjo jonathanjo commented May 21, 2021

This would be really cool, can't comment on the implementation but the idea to dump entries in the daily file and then aggregate or just list would be awesome

@blacksmithgu
Copy link
Owner

@blacksmithgu blacksmithgu commented May 23, 2021

Added for next release 0.3.10. Repeated keys are aggregated into a Dataview list.

@rishifter
Copy link
Author

@rishifter rishifter commented May 27, 2021

@blacksmithgu Thank you so much for this wonderful little update. This enables a lot of tracking without changing the structure of my old notes (since 2006). This is by far my favourite plugin!

@jaroet
Copy link

@jaroet jaroet commented May 27, 2021

@rishifter Apparently this is fixed now but when I try the following query ...

table subject from "daily"
where contains(subject, "[[John Doe]]")

and I have daily note with the following ...

subject:: Talked to [[Jane Doe]] about something
subject:: Phonecall with [[John Doe]] about dog.

The query returns nothing...

I guess I do something wrong?

@rishifter
Copy link
Author

@rishifter rishifter commented May 28, 2021

@jaroet I think that's how contains() works with lists already. It doesn't search inside list items and only matches exact items so contains(subject, "Talked to [[Jane Doe]] about something") works but contains(subject, "[[John Doe]]") doesn't. The docs allude to this difference in behaviour when what's passed is an object, list or string.

@Xtremefaith
Copy link

@Xtremefaith Xtremefaith commented Oct 26, 2021

So with this new functionality if I wanted to place a dataview query under a personal reference to capture all of their records (i.e quotes) how would I do that? At the moment I have something like this in my daily note or other reference

quote:: "Our desires determine our direction" - [[Vince Miller]]

Within my Vince Miller quote I would now expect to place a dataview block that would allow me to list this along with any other references in the future. Is that possible?

@blacksmithgu
Copy link
Owner

@blacksmithgu blacksmithgu commented Oct 27, 2021

@Xtremefaith This functionality has been in for a while, but you can get all quotes in your file doing something like

LIST quote FROM <source> WHERE quote

@overZellis133
Copy link

@overZellis133 overZellis133 commented Jan 20, 2022

How would you dynamically pull all quotes from within a single page as opposed to all pages within a folder?
E.g. all in one page
quote:: "something interesting"
...
quote:: "something else interesting"

In other words, how would you format in your example, @blacksmithgu of:
LIST quote FROM WHERE quote

Use Case
I would like to create a Template for my meetings notes where I automatically aggregate within the current page all lines with a key of "question::" into my Questions part of the page

@blacksmithgu
Copy link
Owner

@blacksmithgu blacksmithgu commented Jan 20, 2022

You can use flatten - LIST quote FROM <place> WHERE quote FLATTEN quote - which will flatten arrays into elements of the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants