Getting Null Values if I use Translation MAP

Hi All,

I am getting null when I get response using below Input, Output contract and Translation map with Success template. But when I use raw result i am getting back data but not in fields template. Please let me know anything I need to change below:

Input Contract

{
"title": "Request",
"type": "object",
"properties": {
"AccountID": {
"type": "string"
}
},
"additionalProperties": true
}

output Contract

{
"title": "Response",
"type": "object",
"properties": {
"AccountBalance": {
"type": "array",
"items": {
"title": "CurrentBalance",
"type": "string"
}
},
"Invoice": {
"type": "array",
"items": {
"title": "DueDate",
"type": "string"
}
},
"Premise": {
"type": "array",
"items": {
"title": "PremiseID",
"type": "string"
}
}
},
"additionalProperties": true
}

Response Configuration

{
"translationMap": {
"AccountBalance": "[$.CurrentBalance]",
"Invoices": "[$.DueDate]",
"Premise": "[$.PremiseID]"
},
"translationMapDefaults": {
"AccountBalance":"[]",
"Invoices":"[]",
"Premise":"[]"
},
"successTemplate": "{\n "AccountBalance" : ${AccountBalance}\n, "Invoices" : ${Invoices}\n, "Premise" : ${Premise}\n }"
}

Thanks for help !!

You would need to post an example of the response from the endpoint to be able to help you troubleshoot. Feel free to redact anything sensitive.

--Jason

When I click Jason In response I get the following response:

"d.AccountBalance.CurrentBalance": "123.45",

"d.Invoices.results.DueDate": [
"/Date(246000000)/",
"/Date(76500000)/",
"d.Contracts.results.Premise.PremiseID": [
"789101112",
"131415161"

Can you give us the output from the "Execute" step? That is the actual response from the endpoint. Note that you can also see the results of your translation map JsonPath extractions.

Once you have that output, you can test your translation map entries in a JSON path tester, like https://www.javainuse.com/jsonpath

Chances are you can find your issues there and debug your jsonpath to get it right.

--Jason

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.