Update the value of a variable

I have the following process:
I check if the element exists using the ‘Element Exists’ activity.

If it is ‘True’ it starts the iterative process in the ‘While’ activity.

At the end of the activity I check again with the same activity (Element Exists) and the same variable if the element still exists, if there is to continue the activity, otherwise stop.

The problem is that the value of the variable is not updating, even when the element does not exist, the process continues to run as if it were still in ‘True’ instead of updating to ‘False’.

Can someone help me please?

You should always use a new variable instead of re-using an old one if they’re being used for different purposes. In this case you can name the first boolean ElementExistsAtStart. Then name the 2nd boolean ElementExistsAtEnd. If it is still having issues then let us know.

In fact the purpose is the same, to check if the element exists.

The question is, if I change the name of the variable how am I going to check this condition in the while?
Would I have two variables to verify the same thing? How would I do this in the while condition?

if ElementExistsAtStart Then (do your DO WHILE activity - your condition being ElementExistsAtEnd) Else (do whatever needs to be done if the element is not found)

You could also have the first thing you do is to ‘reset’ the variable at the top of your While/Do While loop, so the first thing it does is reset the variable back to ‘false’.

I can see it going either way, but it sounds to me like you want to know if element exists at beginning (purpose 1) which is what enters the loop. Then you want to see if element exists after doing the loop (purpose 2) which is what exits the loop. Separating it out into 2 variables, even if only done during debugging, can help determine if that is the cause of your issue.

I followed the logical sequence you said, putting if and exchanging While for Do While, but even so I only succeeded when I changed the reference element, because what I wanted didn’t work.

Thank you for your help

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