cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Mapper Snap JSON expression

SnapIntegration
New Contributor II

I have a mapper Snap to map address from left to right schema.

However, when I run it, I see this error:
Screen Shot 2022-08-12 at 12.01.34 PM
Meaning the jsonPath($, โ€œ$address[0].stateโ€) path cannot be found meaning state = null.

Is there any way I could write JSON expression in the Mapping table part in a Mapper Snap?

Please help!
Screen Shot 2022-08-12 at 12.01.11 PM

4 REPLIES 4

dmiller
Admin Admin
Admin

It sounds like one record in your data set does not have a value for State.


Diane Miller
Community Manager

Yes. How do I pass the null value?

dmiller
Admin Admin
Admin

Select Null-safe access in the Mapper Snap.


Diane Miller
Community Manager

jcornelius
New Contributor III

Just write it like this

jsonPath($, โ€œ$address[0].stateโ€) ? jsonPath($, โ€œ$address[0].stateโ€) : null