I have a feeling that
Monitor Name = CurrentValue
AddOrModifyRows is not behaving as you expect, since
CurrentValue resolves not to a row in
Monitors Template table but to the currently evaluated row within the
Client + Template table (as evident by color coding, although sometimes that’s wrong too), hence the check is always false.
One of the reasons I don’t like
I’d suggest rewrite the formula with explicit conditional instead:
[Monitors Template].Filter(...).FormulaMap( If( [Client + Template].Filter(...).Count() = 0, [Client + Template].AddRow(...), _Noop() ) )
That’s how I’d usually do it. No unnecessary modification too (and no spamming the activity log / touching the Modified() timestamps etc).
P.S. Actually no, that won’t work, since you cannot access outer
CurrentValue from the inner Filter either. You’ll most likely need to implement this trick:
P.P.S. Might be worth looking into the possibility of replacing FormulaMap with individual buttons. on the rows from
Monitors Template, then filtering and clicking those buttons instead. This eliminates the need of one level of
CurrentValue because in those buttons you can read directly from
thisRow, and you won’t need the trick then.