Coming back to my original question:
Will these variable “reset” for each iteration?
What will happen when one of these variables is empty during one iteration? It seems that variable will not get reset to empty and it will retain the last set value. For example:
During iteration one we set var1 to “XX”
During iteration two we don’t set var1. So I would expect it to be “set” to empty string. Instead, as far as I can tell, it still has the value “XX”.
During iteration three we again don’t set var1 and again it retains the value “XX”.
During iteration four we set var1 to “YY” and this indeed overwrites “XX”.
The setting for the lifetime is talking about “one cycle”, which I assumed can be interpreted as “one iteration”. i.e. - when each iteration is over, the variables are “lost”.
Hi @manish_mandot ,
Many thanks for this video.
Your logic is indeed correct but I fear that I haven’t explained myself correctly. The real issue is what happens when one (or more) of the iterations has NO value. See here
As you can see, during the 2nd iteration the value for “var1” isn’t changed, yet it is fetched as per its value during 1st iteration. Same output will happen if you have 1000 iterations, and just 200 of them have values for var1. It’ll keep on outputting the “last known” var1.
This means lifetime is basically “until further notice”, and not just one cycle/iteration.
Am I missing something?
I am not using the Basic trigger in my live scenario. It’s just for this example. The lifetime issue happens regardless of which modules come before the “Get” (single or multiple) module.
Could you please explain what am I missing regarding iteration two in my video? Why didn’t var1 return as “empty” for this iteration?
Are you referring to the fact that I forgot var2?
It’s not very important. I just wanted it as a reference point, but turned out I don’t need it.
Thanks for the kind offer, but I’m not sure I understand why we need to connect.
If we bottom line it, the question is rather simple:
When working with iterators, let’s assume there are two modules
a. Set variable (lifetime: one cycle)
b. Get variable
Module a (Set variable) is triggered based on filter. Filter creates a situation where this module isn’t always triggered, i.e. variable isn’t set for all iterations.
Module b (Get variable) is always triggered.
And the bottom line: For iterations in which module a wasn’t triggered, what should be the output of module b?
My understanding was that output should be empty. My previous post presents a video in which the output was NOT empty.