Forum Discussion

SnapIntegration's avatar
SnapIntegration
New Contributor II
3 years ago

Mapper Snap JSON expression

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

However, when I run it, I see this error:

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!

4 Replies

  • dmiller's avatar
    dmiller
    Former Employee

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

  • jcornelius's avatar
    jcornelius
    New Contributor III

    Just write it like this

    jsonPath($, “$address[0].state”) ? jsonPath($, “$address[0].state”) : null