Apologies if this has been noted. I can’t find anything in the forum but I missed the last half-hour of last Tuesday’s session.
I would use the lookup(
function:
lookup("Test",Field1,Query,Field2)
to fetch data from field Field2
of database “Test”, from the record whose field Field1
equals the contents of the variable Query
.
To achieve the same using related(
, the most literal equivalent seems to be:
related("Field2","database","Test","source key","Field1","key","Query")
That works except when the match is the first record in the database, when I get the error:
Related data error, database Test does not contain a match for A1
(where both the variable Query
and field Field1
of the first record are both “A1”).
I first found this matching the first record of a large pre-existing database. So I tried moving that first record down one place, no longer got the error, but now (not surprisingly) got the error if Query
matched the new first record instead.
Creating a small test database, the same applies: that related(
function fails with the same error whenever it should have found the related field in whichever is first record at the time.