cancel
Showing results for 
Search instead for 
Did you mean: 

optional field on mapper

ashis1upreti
New Contributor II

Hello team

I am getting error "Cannot invoke a method on a null value, snap" due to optional field being absent. In some JSON the "primary_mkt_ind" field is coming as value "NULL" so I have the below check. But in some JSON that I am consuming, that field is entirely not present.

$.get('primary_mkt_ind').toUpperCase() == 'NULL' ? "" : $.get('primary_mkt_ind')

 Can you pls help me get rid of this situation, where I will be doing this NULL check only when that value is coming as null.

"market_exchange_cd": "SCP",
"market_country_cd": "US",
"primary_mkt_ind": "NULL"

 

Thank you in advance!

 

2 ACCEPTED SOLUTIONS

Aleksandar_A
Contributor III

Hello @ashis1upreti,

Please refer to the attached pipeline, and let me know if this is what you want to achieve.

Regards,

Aleksandar.

View solution in original post

ashis1upreti
New Contributor II
2 REPLIES 2

Aleksandar_A
Contributor III

Hello @ashis1upreti,

Please refer to the attached pipeline, and let me know if this is what you want to achieve.

Regards,

Aleksandar.

ashis1upreti
New Contributor II

@Aleksandar_A looks good! Thank you!