cancel
Showing results for 
Search instead for 
Did you mean: 

Failure: Unable to write to JSON-Path

tarena
New Contributor III

JSON Path Test_2023_03_28.slp (6.4 KB)

GOAL: Set up a mapper to write input document structure to new structure, deleting some paths, and renaming others.

ERROR: “Failure: Unable to write to JSON-Path: $.ACHData.employeeId, Reason: Expecting object for JSON-Path field reference ‘employeeId’, found: String, Resolution: Change the path to refer to an object”

How is a String not an Object in this use case?

image

1 ACCEPTED SOLUTION

tarena
New Contributor III

I figured this one out. You can’t add paths to null objects.

Since ACHData is null for the second record, it’s impossible to add ACHData.employeeId. If I reverse the order of the rows in the mapper then the result is that ACHData is null for the record, because ACHData.employeeId is set by the first row and then everything is cleared by the second row.

This is currently undocumented behavior.

View solution in original post

1 REPLY 1

tarena
New Contributor III

I figured this one out. You can’t add paths to null objects.

Since ACHData is null for the second record, it’s impossible to add ACHData.employeeId. If I reverse the order of the rows in the mapper then the result is that ACHData is null for the record, because ACHData.employeeId is set by the first row and then everything is cleared by the second row.

This is currently undocumented behavior.