I’m tidying up a formula, with what feels like a properly constricted fl loop.
So I’m condensing this.
$
lv(“search_term”, “Change pod”)
$$
if(tc(count, ci(title, 0), “#search_term”) > 0, "Pod change "+tf(ci(start, 0)),
if(tc(count, ci(title, 1), “#search_term”) > 0, "Pod change "+tf(ci(start, 1)),
if(tc(count, ci(title, 2), “#search_term”) > 0, "Pod change "+tf(ci(start, 2)),
if(tc(count, ci(title, 3), “#search_term”) > 0, "Pod change "+tf(ci(start, 3)),
if(tc(count, ci(title, 4), “#search_term”) > 0, "Pod change "+tf(ci(start, 4)),
if(tc(count, ci(title, 5), “#search_term”) > 0, "Pod change "+tf(ci(start, 5)),
if(tc(count, ci(title, 6), “#search_term”) > 0, "Pod change "+tf(ci(start, 6)),
if(tc(count, ci(title, 7), “#search_term”) > 0, "Pod change "+tf(ci(start, 7)),
if(tc(count, ci(title, 8), “#search_term”) > 0, "Pod change "+tf(ci(start, 8)),
if(tc(count, ci(title, 9), “#search_term”) > 0, "Pod change "+tf(ci(start, 9)),
“No match”
)))))))))))
$
Into this.
$
lv(“search_term”, “Change pod”)
$$
fl(0, 9, “i+1”, if(tc(count, ci(title, i), “#search_term”) > 0, "Pod change "+tf(ci(start, i)),“No match”))
$
But whereas the repeated statements work as expected, when replacing the count with i in the loop the statements fail with “No Match”