editting within javascript field (concatenated fields)

81 views
Skip to first unread message

Darrren Griffiths

unread,
Sep 27, 2026, 6:09:14 PMSep 27
to mementodatabase
Hi

First post here. I have been using Memento for about a year now and have just started using the javascript field to group and concatenate fields together.

It's really useful as i have a lot of text fields with short entries in them. But it would be great if i could edit those javascript fields instead of finding the correct text field and edit it there.

Is there anyway i could edit the concatenated javascript field? and update the text fields associated with it?

This is what i am using atm

field("apples")+ '\n' +field("oranges")

Bill Crews

unread,
Sep 27, 2026, 8:57:09 PMSep 27
to Darrren Griffiths, mementodatabase
To have editable fields in your library made from library fields, define js fields Fruit1 & Fruit2, then define the editable field Fruits. For the example you give, define a trigger (under Automations in the right-side menu) that runs upon opening the library called whatever you like with the following script:

let entries = lib().entries();
for (e in entries) 
    e.set("Fruits", e.field("Fruit1") + "\n" + e.field("Fruit2"));

There was once a wiki. Now, someone else will have to tell you where to look up how to do these things. The names of the wiki pages were JavaScript field, Triggers, & The Memento JavaScript Library.


--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mementodatabase/8950229d-d341-4823-a1e6-6a673bcb9d99n%40googlegroups.com.

Mmm

unread,
Sep 28, 2026, 6:36:25 AMSep 28
to mementodatabase
Поле JavaScript не может менять значения других полей.
Документация:

Если неудобно изменять текстовые поля, то их можно вывести в одно место для редактирования. 
К сожалению, автор не пояснил логику необходимой автоматизации.

Например, в аргументы скрипта действия карточки записи или меню массовых действий (простой способ) или в диалог (более сложный).

Вариант решения в диалоге для одного поля JS в одной записи.
В функцию вызова диалога передается объект с данными: массив полей, имя поля JS, функция кнопки сравнения с логикой поля JS (для показа результатов в дополнительном диалоге).

В диалоге доступны для редактирования текстовые поля из массива. 
Кнопка "View" показывает в дополнительном диалоге сравнение поля JS до и после изменений.
Кнопка "Save" сохраняет новые значения полей в записи.

Для редактирования данных другого поля JS нужно создать другой объект.

Вызов выполняется скриптом действие в списке.

Библиотека в облаке для тестов (общий доступ, разрешено копирование структуры):

Шаблон в каталоге шаблонов:
понедельник, 28 сентября 2026 г. в 03:57:09 UTC+3, bill....@gmail.com:
editor.jpg

Darrren Griffiths

unread,
Sep 29, 2026, 4:14:29 AMSep 29
to mementodatabase
OK thanks for the info

I think i need to re-read the wiki and do some javascript reading

Thanks again
Reply all
Reply to author
Forward
0 new messages