DA Error - Response - NULL

Hi,

I need your help. The problem is easy to detect, but I can't find the solution.
I have already visited some possible solutions, but they have not been successful for me.

Currently, I am using the headers: accept and content-type, application/json. This is a GET query.

--- Error:
Error location: /ATN_CIF__c/0. instance type (null) does not match any allowed primitive type (allowed: [\"string\"])"

--- Response:

{
  "translationMap": {
    "Id": "$.records[*].Id",
    "Name": "$.records[*].Name",
    "ATN_CIF__c": "$.records[*].ATN_CIF__c"
  },
  "translationMapDefaults": {
    "Id": "[]",
    "Name": "[]",
    "ATN_CIF__c": "[]"
  },
  "successTemplate": "{\"Id\":${Id}, \"Name\":${Name},\"ATN_CIF__c\":${ATN_CIF__c}}"
}

--- Apply output transformation:

{
  "Id": [
    "0015t***Z",
    "0015t**Z"
  ],
  "Name": [
    "nadp",
    "B Genesys Cloud"
  ],
  "ATN_CIF__c": [
    null,
    "123456789"
  ]
}

--- Validate output against schema:

{
  "message": "JSON failed output schema validation for the following reasons: Schema: # @/properties/ATN_CIF__c/items.  Error location: /ATN_CIF__c/0.  instance type (null) does not match any allowed primitive type (allowed: [\"string\"])",
  "code": "invalid.schema",
  "status": 400,
  "messageParams": {},
  "contextId": "3245db85-74f2-4156-****-5af49818d96c",
  "details": [
    {
      "errorCode": "ACTION.PROCESSING"
    }
  ],
  "errors": []
}

Thanks in advance.

So you can get the error to go away by making your translation map ignore null values, using something like this:

$.records[?(@.ATN_CIF__c != null)].ATN_CIF__c

However, this may give you other problems since the array of values in ATN_CIF__c will no longer line up with the arrays for Id and Name.

If ATN_CIF__c being null means that the entire record can be discarded, then you could use the same filter logic for Id and Name as you use for ATN.

If you have control over the endpoint you could see if it could return "" instead of null.

If none of those options work, then you could hit the endpoint and modify the response with an AWS Lambda, Google Function, or our Genesys Cloud Functions beta (Genesys Cloud - Beta HQ - Genesys)

--Jason

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