cancel
Showing results for 
Search instead for 
Did you mean: 

JSON Root value

walkermic
New Contributor III

I have an IDOC listener that will receive json files of different formats. The root of the json file will be different for the different types. I need to evaluate the root value(PEXR2002 in this example) and then route it based on the value to other child pipelines. I cannot figure out how to get the value out. Anyone know?
{
“PEXR2002”: {
“IDOC”: {
@BEGIN”: “1”,
“EDI_DC40”: {
@SEGMENT”: “1”,
“TABNAM”: “EDI_DC40”,
“MANDT”: “100”,
“DOCNUM”: “0000000002472008”,
“DOCREL”: “731”,
“STATUS”: “30”,
“DIRECT”: “1”,
“OUTMOD”: “2”,
“IDOCTYP”: “PEXR2002”,
“MESTYP”: “PAYEXT”,
“STDMES”: “PAYEXT”,
“SNDPOR”: “SAPS41”,
“SNDPRT”: “LS”,
“SNDPRN”: “S41CLNT100”,
“RCVPOR”: “SNAPLOGIC”,
“RCVPRT”: “LS”,
“RCVPRN”: “SNAPLOGIC”,
“CREDAT”: “20181205”,
“CRETIM”: “220141”,
“SERIAL”: “20180917101221”
},
“E1IDKU1”: {
@SEGMENT”: “1”,
“BGMTYP”: “PEX”,
“BGMNAME”: “EXTENDED PAYMENT ORDER”,
“BGMREF”: “2000000796”,
“BGMLEV”: “ORG”,
“BGMACC”: “001”
},
“E1EDK03”: [
{
@SEGMENT”: “1”,
“IDDAT”: “011”,
“DATUM”: “20180917”,
“UZEIT”: “101221”
},
{
@SEGMENT”: “1”,
“IDDAT”: “028”,
“DATUM”: “20180917”
},
{
@SEGMENT”: “1”,
“IDDAT”: “017”,
“DATUM”: “20180918”
}
],
“E1EDK02”: {
@SEGMENT”: “1”,
“QUALF”: “029”,
“BELNR”: “2000000796”
},
“E1IDKU2”: {
@SEGMENT”: “1”,
“BUSFUN”: “001”,
“BUSGEO”: “DO”,
“BUSZFO”: “001”
},
“E1IDKU3”: {
@SEGMENT”: “1”,
“PAIRZAWE”: “T”,
“PAYRUNCC”: “0001”,
“PAYRUNID”: “COMM3”,
“PAYRUNDT”: “20180917”,
“RELNUM”: “000000050005”
},
“E1IDKU5”: {
@SEGMENT”: “1”,
“MOAQUAL”: “002”,
“MOABETR”: “9000.00”,
“CUXWAERZ”: “USD”
},
“E1IDB02”: [
{
@SEGMENT”: “1”,
“FIIQUALI”: “BA”,
“FIIBKENN”: “XXXXXXXXXXXXXXX”,
“FIIBKCDE”: “002”,
“FIIBKUKN”: “021000021”,
“FIIBKUCD”: “003”,
“FIIBKNAM”: “XXXXXXXXXXXXXXX”,
“FIIBKORT”: “TAMPA”,
“FIIBLAND”: “US”,
“FIIKONTO”: “XXXXXXXXXXXXXXX”,
“FIIKWAER”: “USD”
},
{
@SEGMENT”: “1”,
“FIIQUALI”: “BB”,
“FIIBKENN”: “XXXXXXXXXXXXXXXXX”,
“FIIBKCDE”: “003”,
“FIIBKNAM”: “XXXXXXXXXXXXXXXXXXx”,
“FIIBKORT”: “CHICAGO”,
“FIIBLAND”: “US”,
“FIIKONTO”: “XXXXXXXXXXXXXX”,
“FIIKNAME”: “XXXXXXXXXXXXXXXXXX”,
“FIIBKONT”: “01”
}
],
“E1EDKA1”: [
{
@SEGMENT”: “1”,
“PARVW”: “AG”,
“NAME1”: “XXXXXXXXXXXXXX”,
“STRAS”: “XXXXXXXXXXXXXXXX”,
“PFACH”: “2020”,
“ORT01”: “XXXXXXXXXXXXX”,
“PSTLZ”: “72762”,
“PSTL2”: “72765”,
“LAND1”: “US”,
“TELF1”: “(479)290-4000”,
“SPRAS”: “E”,
“ORT02”: “WASHINGTON”,
“REGIO”: “AR”,
“ISOAL”: “US”
},
{
@SEGMENT”: “1”,
“PARVW”: “BE”,
“PARTN”: “0000001018”,
“NAME1”: “XXXXXXXXXXXXXXXx”,
“NAME2”: “TEST NAME UPDATE”,
“NAME3”: “TEST TEST TEST”,
“NAME4”: “TEST”,
“STRAS”: “ONE APPLIED PLZ”,
“PFACH”: “XXXXXXXXXX”,
“ORT01”: “CLEVELAND”,
“PSTLZ”: “XXXXXXXXXXX”,
“PSTL2”: “XXXXXXXXX”,
“LAND1”: “US”,
“TELF1”: “XXXXXXXXXX”,
“TELFX”: “XXXXXXXXXXX”,
“ORT02”: “CUYAHOGA”,
“REGIO”: “OH”,
“ISOAL”: “US”,
“PFORT”: “PASADENA”,
“SPRAS_ISO”: “EN”
}
],
“E1IDPU1”: {
@SEGMENT”: “1”,
“DOCNAME”: “INV”,
“DOCNUMMR”: “5000005346”,
“DOCDATUM”: “20180917”,
“E1IDPU5”: [
{
@SEGMENT”: “1”,
“MOAQUAL”: “004”,
“MOABETR”: “9000.00”,
“CUXWAERZ”: “USD”
},
{
@SEGMENT”: “1”,
“MOAQUAL”: “003”,
“MOABETR”: “0.00”,
“CUXWAERZ”: “USD”
},
{
@SEGMENT”: “1”,
“MOAQUAL”: “005”,
“MOABETR”: “0.00”,
“CUXWAERZ”: “USD”
},
{
@SEGMENT”: “1”,
“MOAQUAL”: “006”,
“MOABETR”: “9000.00”,
“CUXWAERZ”: “USD”
}
],
“E1EDP03”: [
{
@SEGMENT”: “1”,
“IDDAT”: “016”,
“DATUM”: “20180917”
},
{
@SEGMENT”: “1”,
“IDDAT”: “015”,
“DATUM”: “20180917”
}
],
“E1EDP02”: [
{
@SEGMENT”: “1”,
“QUALF”: “009”,
“BELNR”: “5000005346”
},
{
@SEGMENT”: “1”,
“QUALF”: “010”,
“BELNR”: “5200000898”
}
]
},
“E1IDLU5”: [
{
@SEGMENT”: “1”,
“MOAQUAL”: “002”,
“MOABETR”: “9000.00”,
“CUXWAERZ”: “USD”
},
{
@SEGMENT”: “1”,
“MOAQUAL”: “003”,
“MOABETR”: “0.00”,
“CUXWAERZ”: “USD”
}
]
}
}
}

1 ACCEPTED SOLUTION

walkermic
New Contributor III

Close. I got it to work with $.entries()[0][0]

Thanks!

View solution in original post

5 REPLIES 5

walkermic
New Contributor III

Close. I got it to work with $.entries()[0][0]

Thanks!