I am trying to write a query in the AB window to find notes + descendants with a certain pattern…
Where I am getting stuck is in displaying the descendants of the parent notes rather than the query part. I guess I do not quite understand the group designators as good as I need to. More specifically, I seem to get stuck in understanding how to use the designators especially children and descendants. I have reviewed aTBRef but am still finding a bit of a block. I thought maybe some examples from the forum might help me as well as other people that have a “gap” here as well. Cheers.
Anyway…
I am good in the first part of the query up to & How do I display the designators in the second part of the the query?
For example:
$Name.icontains(^NotesIamTryingToFind) & ??
Are we looking for all the descendant notes of any note(s) with a particular pattern in $Text, or descendants of given notes(s) where the descendants contain a particular pattern in text.
That doesn’t look quite right (though may work accidentally due to legacy syntax support). Assuming the ^ is intended as a start-of-string regex marker, I think best practice would be to use
$Name.icontains("^NotesIamTryingToFind")
As pattern string literal, whether including regex or note, in .contains/.icontains should be enclosed in quotes.
If I understand the requirement, correctly, this query displays in AB the children of the parent(s) whose name satisfies the search string requirement. At least, over here it does.
$Name.icontains("^NotesIamTryingToFind")
Thanks for spotting this…
2.Are we looking for all the descendant notes of any note(s) with a particular pattern in $Text, or descendants of given notes(s) where the descendants contain a particular pattern in text.
I am looking for the parent with the above pattern + all descendants.
Thanks Tom