Skip to main content

Hi Team

I need to discard records which have even one field null and other records should pass. This should happen in loop. If I use pre-condition/stream selector, even if 1 record fails conditions, rest pass, even then entire flow gets discarded.

 

records are comming as below in javascript

recordssi].value.AA0]]‘x1]

recordsci].value.Al0].‘x2’]

recordspi].value.A]1]a‘x1’]

records/i].value.Ad1]i‘x2’]

If records>i].value.Ar0]o‘x1’] is null/recordsni].value.Au0]/‘x2] is null, only Aa0] should be discarded. and As1] should flow this way I need

 

 

In this case can anyone help me how to achieve this in groovy? javascript?

@Priyanka Mynepally 

can you please try your data in for loop like below code snippet.

If i can get the input details then i can provide the complete code for your requirements.

 

e.g

code snippet to discard rows having null values

for (i=0; i < 3; i++) {

      if (Aii]  == null ) {

          continue

          }

     sdc.output.write(i)

}


Reply