Find notes that have a value in an attribute

This one should be simple, but I can’t seem to figure it out. If I have an attribute $APIType. How do I find all the notes here the “has a value” argument is true?

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

1 Like

“Chagrined emoji” … see I told you it was obvious. Thanks. :slight_smile:

1 Like

For any type of attribute the query:

$AnyAttribute

is true if the attribute AnAttribute has a locally set value (this can also be tested with hasLocalValue(). This was added for the case where the user mistakenly set an attribute in an note using a prototype rather than in the prototype, but as here may be used more widely.

In the past it was possible (per the previous post) to, for instance, to set a local value of "" (i.e. no string) for string-type attributes. But in recent versions (version?+) if a note is set to a value matching the default - i.e. setting a String with default "" to "" the attribute is treated as inheriting (which makes sense)

So, having given the background, an agent of:

$APIType

Will match all notes with a value for $APIType. It matches both prototypes and notes using that plus any with a locally set, non-inherited value. If we query:

hasLocalValue("APIType")

we get the same. But likely in your case we want to match prototypes with a value for $APIType and notes with a local $APIType but not those inheriting one. So try:

$APIType & $Prototype==""

This will give you prototypees with a value for $APIType and notes with a value for $APIType which is not inherited from a prototype.

Does that help?

1 Like

Corrected…yes, it does help and work…(was not patient enough to let the agent run). I was not familiar with a non-attributer action without a $. Cool, thanks.