Skip to main content
Solved

Groovy evaluator


How do I write else if loop in groovy evaluator 

Example: the if-else loop in expression evaluator is written in below way: 

${record:value('/phone_home[0]') != ' ' ? record:value('/phone_home[0]'):

(record:value('/phone_home[1]') != ' ' ? record:value('/phone_home[1]'):

(record:value('/phone_home[2]') != ' ' ? record:value('/phone_home[2]'): ' '))}

 

How do I implement Same-Example thing in groovy evaluator,

Since there are dynamic number of rows coming each time, [sometimes number is 10, sometimes 100 etc, so need to write for-loop]

Best answer by saleempothiwala

@Priyanka Mynepally 

 

Here: 

 

You can use the same concept in Groovy and iterate for all the phone numbers.

View original
Did this topic help you find an answer to your question?

6 replies

saleempothiwala
Headliner
Forum|alt.badge.img
@Priyanka Mynepally

if(condition) {   
   statement #1   
} else if(condition) {   
   statement #2   
} else {   
   statement #3   

 

@Bikram  shared some code earlier about looping using Evaluators. Let me find the thread for you.


saleempothiwala
Headliner
Forum|alt.badge.img

@Priyanka Mynepally 

 

Here: 

 

You can use the same concept in Groovy and iterate for all the phone numbers.


It was helpful. Thanks,

Could you please help me with groovy-code as well.


saleempothiwala
Headliner
Forum|alt.badge.img

@Priyanka Mynepally please share the sample data


same data as in before example


same data used in jython example


Reply