Filter Linked Records

109 views
Skip to first unread message

Andreas Spelter

unread,
Jan 1, 2026, 3:37:23 PMJan 1
to mementodatabase
Hi,

I am really missing filters for linked fields.

Imagine I have a table called "Projects" with a field called "Description" among others. Another table called "Tasks" has a checkbox field called "Completed", among other things.

In "Projects", I get a wonderful list of all the tasks linked to the respective project, and I can sort the list – so far, so good. But what I'm really missing is the ability to filter here. I want to be able to see only those tasks in "Projects" that are not yet completed, or only those with high priority, or overdue, or...

It would be nice if the filters created in "Tasks" could also be used in "Projects" for the linked records.

Or is there already a way to do this?
Looking forward for your solutions.

Best regards
Andreas

Mmm

unread,
Jan 2, 2026, 3:18:14 AMJan 2
to mementodatabase
Самый простой вариант решения – добавить поля JS в библиотеку Проектов, которые будут проверять критерии записей библиотеки Задачи.
Например "выполнение":

if (field("Tasks").length > 0) {
    field("Tasks").filter(a => a.field("completed") == false).length;
} else {
    -1;
}

Теперь по полю JS можно создать фильтры по числу:
равно 0 – все задачи выполнены;
больше 0 – есть не выполненные задачи;
равно -1 – задачи отсутствуют.

Создать поля и фильтры для других критериев – высокий приоритет, ...
Поля можно поместить на отдельной странице, а после отладки скрыть ее.

четверг, 1 января 2026 г. в 23:37:23 UTC+3, spelt...@gmail.com:

Andreas Spelter

unread,
Jan 2, 2026, 10:14:10 AMJan 2
to mementodatabase
Hm, yes, it shows me the correct numbers within "Projects", but it does not update the numbers if I modify a task from within "Projects". If I change to "Tasks" and back to "Projects" it updates.
Any idea how to fix that?

However: Better than nothing but not really what I like - I love it to much to click on a task in the project and modify it. Would be really great if the "Tasks" filters would become available in "Projects".

Would it be possible to add a "link to tasks" within projects and let that automatically fill with the filtered tasks?

David Gilmore

unread,
Jan 2, 2026, 10:30:54 AMJan 2
to mementodatabase
I do not believe there is a direct way to filter like that. Maybe some of the other clever folks here have other solutions. But what I believe you need as an "Ad Hoc" report generation method, that would format the information the way you want, filtering out what you don't want, and sorting the data the way you do want. Of course, generating a report is a little cumbersome, having to export the report, then use another app to view it.

A long time ago, before Memento had "Dialog" capability, there was a problem where "Toast" messages where short and only were on the screen for a few seconds. As a work around for this, a method was created to show a full page HTML screen to the user, that would remain on the screen until it was dismissed, and then return to whatever the user was doing.

This was somewhat deprecated when the "Dialog" capability was implemented in Memento, but I continue to use it as it is useful for full page Help Screens and for Ad Hoc reports like this. The screen is built using HTML tags, then the "Toast" library is called to display that full page toast.

For example, I have a list of Restaurants that I visit, filtered by area. The list is normally in Alphabetical order, which makes it easy to find a specific restaurant. But there are times when trying to decide what to eat, when I want to see which restaurants I have not visited for awhile. So I want to sort the restaurant list by date visited. Changing the sort order dynamically is a little awkward in Memento, so to have an Ad Hoc method of displaying the list temporarily sorted by date and filtered by area is what was needed. This Toast method was the way to do exactly that.

This thread from December 2023 described how to do this:

https://groups.google.com/g/mementodatabase/c/MgdqN3hhYKk/m/e881bYtqAAAJ

The drawback to this is that the report is not interactive, so you cannot go directly from the report to a specific entry.

If you are interested in more information on how to implement this, let me know. 

Mmm

unread,
Jan 2, 2026, 10:41:30 AMJan 2
to mementodatabase
Установите в полях JS выполнять в реальном времени.
К сожалению, задать фильтр или пресет с помощью скрипта нельзя.
Так же нет возможности изменить из одной библиотеки фильтр в другой.

пятница, 2 января 2026 г. в 18:30:54 UTC+3, aa6...@gmail.com:

Mmm

unread,
Jan 3, 2026, 5:21:16 AMJan 3
to mementodatabase
>>> Would it be possible to add a "link to tasks" within projects and let that automatically fill with the filtered tasks?

Вы можете это сделать с помощью скриптов (триггер, скрипт действие, кнопка). Для этого нужно воссоздать нужный фильтр с помощью filter(), find() или sql() и сохранить результат в поле связь.

Во вложении шаблоны библиотек с примером.
Скрипт кнопки отбирает задачи с типом "новая задача". Изменяет тип найденных задач на "в работе". Сохраняет задачи в поле связь.

пятница, 2 января 2026 г. в 18:41:30 UTC+3, Mmm:
Projects.mlt2
Reply all
Reply to author
Forward
0 new messages