cancel
Showing results for 
Search instead for 
Did you mean: 

JSONPath to select items from root array

omair
Contributor

I have the following JSON. I’m struggling on how to write a mapper that captures $[0].original from the JSON below…

[
{
“Id”: “0036A00000AbbdpQAB”,
“FirstName”: “Andrew”,
“LastName”: “Ramirez”,
“hed__AlternateEmail__c”: “aramirez@destinysolutions.com”,
“original”: {
“FirstName”: “Andrew”,
“LastName”: “Ramirezy”,
“Email”: “aramirez@destinysolutions.com
}
},
{
“Id”: “0036A00000AbbeOQAR”,
“FirstName”: “Andrew”,
“LastName”: “Mayzak”,
“hed__AlternateEmail__c”: “4541474710648498@destinysolutions.com”,
“original”: {
“FirstName”: “Andrew”,
“LastName”: “Ramirezy”,
“Email”: “aramirez@destinysolutions.com
}
},
{
“Id”: “0036A00000Vatj6QAB”,
“FirstName”: “Andrew”,
“LastName”: “Ramirez”,
“hed__AlternateEmail__c”: “aramirez@destinsolutions.com”,
“original”: {
“FirstName”: “Andrew”,
“LastName”: “Ramirezy”,
“Email”: “aramirez@destinysolutions.com
}
}
]

$original is validated by SnapLogic but returns me an array which is not what I want…
$[0] fails validation by SnapLogic. Can anyone suggest valid JSONPath syntax in SnapLogic that will select the $original subtree in the first element of the root array?

3 REPLIES 3

SandeepVemula
Contributor

Use JSON Splitter

omair
Contributor

@SandeepVemula … I tried a JSON splitter but it doesn’t appear to work…

image

Here’s my attached pipeline

SFTestReadMulti_2018_06_19.slp (9.1 KB)

SandeepVemula
Contributor

Use Head Snap

image