Page 1 of 1

How does the condition "execution count" work?

Posted: 01 Aug 2014 10:55
by kintrupf
The help says "An internal counter is incremented whenever the condition is executed. The counter is reset to zero when to condition is met."
So when I construct a simple loop with an Execution Count condition I would expect that the loop executes exactly count times each time the flow runs, since the internal counter should always reach count and then reset itself for the next time the flow is run.

However, if I set count to 3 the loop often executes only 1 or 2 times. Why?
I've added a very simple example loop:
execution_count_example.xml
(1.42 KiB) Downloaded 1040 times
It would be great to use Execution Count for simple loops instead of manually controlling a loop counter with scripts and expressions.
It would then also be nice to be able to initialize count with a variable and also have optionally the Execution Count condition fill a variable with the current count ;)

Re: How does the condition "execution count" work?

Posted: 01 Aug 2014 14:48
by sambarlick
I have a similar but opposite issue with the execution count. I am working on a flow that when i get home sends a text to my wife telling her I'm home.

I set the execution count to 1 message per day. This seemed to do nothing as it sent more than one per day.

What are u trying to achieve with the execution count?

Sam

Re: How does the condition "execution count" work?

Posted: 01 Aug 2014 20:07
by kintrupf
sambarlick wrote:What are u trying to achieve with the execution count?
I would like to use it for simple loops within my flows.
According to the help it should work, but I can't figure out why it does not.

Re: How does the condition "execution count" work?

Posted: 02 Aug 2014 14:00
by sambarlick
When i first started using automagic i used sleeps to keep the flows alive, but this caused issues with the flows. I'm not sure if the flows are ment to be kept alive.

I'm also not sure why the execution action doesn't work properly.

Sam

Re: How does the condition "execution count" work?

Posted: 03 Aug 2014 00:00
by plasticmagnet
Condition works correctly.
For some reason i couldnt attach the file so i used drive.

Example Execution count:
https://docs.google.com/file/d/0B33y-aB ... cslist_api

Re: How does the condition "execution count" work?

Posted: 04 Aug 2014 15:59
by Martin
The condition is false until the execution count is reached, at this point the condition returns true and resets the counter. An execution count of 1 therefore returns always true since it counts to one, and resets the count to zero.

The condition produces following result:
Execution Count: 1 times: true, true, true, true, true, ...
Execution Count: 2 times: false, true, false, true, false, ...
Execution Count: 3 times: false, false, true, false, false, true, ...

Regards,
Martin