How to put two condition in While loop?

Hi All,

I’m new to WorkFusion. Can anyone tell me how to put two conditions in a While loop?

example: string.is empty and ${counter}<5

Regards
Amaresan.P

Hi @Paranthaman

You can put one condition inside another one, like on the screenshot

Also, you can use custom script to use multiple conditions - https://kb.workfusion.com/display/RPAe/Code+Samples#CodeSamples-ComparingmorethanonevariableinIf-ElseconditionBlueCOMMUNITY

1 Like

@iostapuk

Thanks for Reply

i want in while loop … is there any possible in while loop

@iostapuk

The Custom script allowed vb.net or c#?

Yes, you can use it with a While loop.

Here is an example of such script.
If either of the conditions inside the custom script becomes false, the variable ${condition1} will become false, and the loop will stop.

In a custom action, you can use Groovy or Java.

@CustomScriptAction(
    input = ['test_var'],
    output = 'condition1'
)
 
def customScript() {
if (
	(!(test_var).isEmpty()) && // 1st condition AND
	((test_var) != (RString.of("0"))) // 2nd condition
	){	{ 
       def condition1 = RBoolean.of(true)
     } else{
       def condition1 = RBoolean.of(false)
       }
}
1 Like