Solved

Groovy-Evaluator doubt

  • 16 November 2022
  • 1 reply
  • 43 views

I have input coming from source as records. Record-1 is xyz, record 2 is abc…

I need to merge all these values into a list by checking few conditions in groovy.

How do I achieve that. Finally output should come in groovy when reading all records is over.

like [xyz,abc,pqr]

 

But I am getting code output as

Output for record-1 [xyz]

output for record2 -[abc] and so on

Can someone please help me how its possible?

icon

Best answer by saleempothiwala 16 November 2022, 11:05

View original

1 reply

Userlevel 4
Badge

@Priyanka Mynepally 

 

Firstly, check if you are processing record by record or batch by batch. This is an advance property on your Groovy evaluator.

 

Next, by default, as soon as data is processed per record, sdc.write will write the output record. If you move this line of code after your records loop then it will write only once when the batch finishes. 

 

I hope that helps.

Reply