Operator Type:
Operator Scope of Action:
Operator Purpose:
Data Type Returned:
Operator First Added:
Operator in Current Baseline:
Operator Last Altered:
Operator Uses Scoped Arguments:
Operator Has Optional Arguments:
Function [other Function type actions]
Item [operators of similar scope]
Query Boolean [other Query Boolean operators]
boolean test
v4.6.0
Baseline
As at baseline
linkedFrom(scope[, linkTypeStr])
A test for inbound links. This boolean test at returns true
if the current note has a least one link from any of the note(s) defined by scope; this is optionally filtered to only links of type linkTypeStr. Put another way:
- "Does an inbound link exist to the current note from any of scope's item(s)?".
or
- "Do any of scope's item(s) have an outbound link to the current note?".
As this is effectively only a query term, (with a Boolean result), if trying to collect data about the linked note(s), use links() instead.
scope defines a group of items in a number of ways. An additional option to normal group descriptors is a wildcard designator *
that matches all notes in the document and replaces the normal "all" group designator.
For linkTypeStr, links of type 'prototype' are ignored. Used in an agent, 'this' note is the alias in the agent and not its original, making this action unsuitable for testing in an agent action. If using linkTypeStr, you must use the value "*untitled"
to match an 'untitled' type link (rather than an empty string, "", or "untitled").
Thus, to test if any note using the 'Event' prototype has an inbound link of the 'untitled' link type the agent query would be:
$Prototype=="Event" & linkedFrom("*", "*untitled")
The logical opposite of this test is linkedTo().
This function can match a link from an alias as opposed to an original (if the logical choice).
Working with aliases
If testing links using aliases (e.g. those created by an agent query) be aware that, for basic type links only, the original and alias can and may have differing numbers of basic links. Thus if wishing to check, unambiguously, the original's links from the context of one of its aliases, use originalLinkedFrom() instead.
Legacy issues
This replaces the legacy #linkedFrom query operator (deprecated since v4.6).
Counting links (of a type)
To know how many inbound links there are, use links() and .count() the resulting list.
See also—notes linking to here: