Here is an instance of a single json doc:
{
"GeneralInfo": {
"Attributes": {
"Name": "Test Name",
"_id": "1996837697",
"Description": "Test Description"
},
},
"_recordId": "56v6t19xp9rni7",
"_recordDate": "06-Feb-2015"
}
For simplicfaction, I’d like to extract _recordId and _id out of the document. Using JsonExtract Mapper UI i come up with:
<Mappings>
<Mapping element="json_object">
<Mapping element="GeneralInfo">
<Mapping element="Attributes" outPort="0"
xmlFields="../../{}_recordId;{}_id"
cloverFields="_recordId;_id">
</Mapping>
</Mapping>
</Mapping>
</Mappings>
However, the result on the port0 produces null value for first field (parent _recordId):
null , <_id value>
Can anyone tell me what i’m doing wrong? Looking at the documentation , xmlFields=“…/…/{}_recordId” should be valid way to access parent.
I was able to do exact same using JsonReader by manually typing:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Context xpath="/root/object" outPort="0"> -->
<Mapping cloverField="_recordId" xpath="_x005frecordId"/>
<Context xpath="GeneralInfo/Attributes" outPort="1">
<Mapping cloverField="_id" xpath="_x005fid" />
<Mapping cloverField="_recordId" xpath="../../_x005frecordId" />
</Context>
</Context>