Break activity is not working in while

Hi,

I am unable to use break activity inside while loop when condition is met.

Can someone please help.

Studio version is 2019.10.2

image

Hi,

There are 2 types While activity.

In the recent version of System.Activities package, there is “InteruptibleWhile” activity. We can use Break activity in it.

However, in older version of System.Activities package (such as 19.10.1), there is just “While” activity. We cannot use Break activty in it.

So if we want to use Break activity in While activity, we need to upgrade System.Activities package higher version (such as 20.10.x ,21.10.x etc)

Regards,

1 Like

You can use an equivalent ForEach to this While Loop:

If initial count is 1 and final count is 10, these are the values for the counter variable:
image

Syntax used in ForEach:

Enumerable.Range(InitialCount, FinalCount-InitialCount)

Best,
Charbel

1 Like

@Charbel1 Thank you very much …

Can you add xaml file please

You’re welcome!

Yes, sure here it is:
ForEach Break.xaml (7.1 KB)

Best,
Charbel

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.