Iterating through the fields using a JavaScript field

48 views
Skip to first unread message

Keith G

unread,
Jul 17, 2026, 9:11:05 PM (5 days ago) Jul 17
to memento...@googlegroups.com
Hi

I have two (or possibly more) fields of type 'Link to entry'. I would like to be able to use a JavaScript field to iterate through all of the fields (in order) in the current record and retrieve the FIRST 'Link to entry' field without knowing its name. 

Is this possible? 

Thanks 

Mmm

unread,
Jul 18, 2026, 7:30:42 AM (5 days ago) Jul 18
to mementodatabase
Предположу, что Вы не являетесь владельцем библиотеки или отсутствует доступ к структуре.
Получить имена всех полей можно, если известно имя библиотеки.

let names = libByName('lib_name').fields();
message(names);

Но определить тип поля по его имени с помощью скриптов нельзя.

Некоторые поля доступны в расширенном поиске, в том числе поля-связи.

Открыть библиотеку => Поиск => Фильтры.
Далее можно понять какие поля являются полями-связями и к какой библиотеке они принадлежат.

Примеры в облаке (только чтение, структура скрыта, имя поля-связи скрыто):

Будут доступны несколько дней.

Попробуйте определить имя поля-связи в B1.

суббота, 18 июля 2026 г. в 04:11:05 UTC+3, Keith G:

Keith G

unread,
Jul 18, 2026, 7:54:58 AM (4 days ago) Jul 18
to Mmm, memento...@googlegroups.com
Thank you.
I think this will give me what I need.

--
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/ea9f3713-2b91-4e58-811d-68673ce6cb9dn%40googlegroups.com.

Keith G

unread,
Jul 18, 2026, 8:08:31 AM (4 days ago) Jul 18
to Mmm, memento...@googlegroups.com
Doesn't work... 

ReferenceError: "libByName" is not defined. (field.js#1)

I assume you realise that I'm running this in a JavaScript field. Is the usual API not accessible from JavaScript field?

On Sat, 18 Jul 2026, 12:30 Mmm, <mii...@gmail.com> wrote:
--

Mmm

unread,
Jul 18, 2026, 8:20:24 AM (4 days ago) Jul 18
to mementodatabase
В поле JS это не работает. Выполните скрипт действие.
Сохранить имена полей можно с помощью log(), результат сохранится в журнале скриптов.
Или добавьте в библиотеку текстовое поле и сохраните имена полей в нем.
В поле JS доступны только поля записи.

Трудно давать рекомендации, если неизвестно, что требуется в результате.

суббота, 18 июля 2026 г. в 15:08:31 UTC+3, Keith G:
Reply all
Reply to author
Forward
0 new messages