You described the details about the main issue but… what is your question?
As far as speed goes, it’s going to be slow because you are accessing a stored variable in a loop. Every access takes a while. You need to use an app variable in the loop instead. So, assign the stored variable value to an app variable. Only use stored variables when you need to load the value into an app variable (when screen opens) or when you change the value of the variable. Any time you are just accessing the variable’s value, use the app variable because it is much faster.
I’ve replaced it with this to avoid the get value block and added an app variable to use it for the loop.
Still not working. This one doesn’t even go on DO, goes straight to ELSE.
Time-wise, same thing, a good few seconds to run the loop and that with 3 records (2 Completed and 1 Active)
It takes several seconds to run that loop?! What happens if you remove the two custom “view” functions from the loop? Does it still take several seconds? It shouldn’t. It should be almost instantaneous. And if it’s much faster without them, then it’s the content of those two functions that is slowing things down.