Random() for filtering bases

Use case or problem

I embed random quotes that I have in a Base or similar notes in my daily note as a motivation or to work on.

For me it is important, that the randomization can be fixed, so executed e.g. only on first execution aka file creation, not with every refresh of the page. So that I can review later on, what was the random inclusion on a particular day.

Proposed solution

I would love to have a random-function for the filters in Bases. The existing random-function is only available in formulas and refreshes to often.

If it would be implemented as a trailing function in sorting e.g. file.inFolder("testfolder").random() it might be useful to have an optional limit parameter e.g. file.inFolder("testfolder").random(10) for 10 random results.

Current workaround (optional)

Using a custom Dataviewjs-function that I would love to eliminate using buildin bases only.

This workaround might work, but doesn’t suit my use case entierly: https://www.reddit.com/r/ObsidianMD/comments/1n22e04/showing_a_random_note_in_bases_or_sorting_notes/

There is even a core plugin to display random notes ( Random note - Obsidian Help ), so it seems a common use case to me. But it can’t be used for embeddings.

Related feature requests (optional)

Bases: Add a simple hash function or allow random() function to take seed-values as input but in the filters

3 Likes

Plus 1

1 Like