Legacy Dev Forum Posts

 View Only

Sign Up

DA Error - Response - NULL

  • 1.  DA Error - Response - NULL

    Posted 06-05-2025 18:46

    JavieR | 2024-06-03 02:32:53 UTC | #1

    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.


    Jason_Mathison | 2024-06-03 02:48:37 UTC | #2

    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 ATNCIF_c will no longer line up with the arrays for Id and Name.

    If ATNCIF_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 (https://community.genesys.com/communities/genesys-cloud-beta-hq?CommunityKey=cbd2f140-168a-4c15-aacb-af2b23aa4329)

    --Jason


    system | 2024-07-04 02:49:30 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 26534