OK, your rule is:
Asks: "if this note is inside container at path “/Inbox” and $Topic is empty, make this note red. But as ‘this’ note is Inbox, it can’t be inside itself so the first query terms always evaluates
false and the colouring code is never run.
What is not clear is if you are trying to colour the Inbox or the container item:
- If the container, is it if
- one item (
any(children)) has no topic?
- or of all children (
every(children)) has no topic?
- or, do you wish to colour the child item with no $Topic? If so,
- only that child,
- or all children?
If your description of the task is ambiguous it is likely, as here, that the resulting code will not work as expected.
So, what exactly is the task?