Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Translation map for array

    Posted 10-09-2025 13:23

    Hi y'all, hoping someone here can give me a hand.

    I have configured a Data Action to call an endpoint to our CRM that returns ticket history. The action is working and I see data being returned in the "Execute" section of the test interface, but my Output is just showing blank entries. The correct field names are there, but no data (and there are multiple records being returned).

    Any ideas?  Here's my Output contract;

    {
      "type": "object",
      "properties": {
        "tickets": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "ticketUid": {
                "type": "integer"
              }
            }
          }
        }
      }
    }
    And my Translation Map;
    {
      "translationMap": {
        "tickets": "$.tickets"
      },
      "translationMapDefaults": {
        "tickets": "[]"
      },
      "successTemplate": "{\"tickets\": ${tickets}}"
    }

    #DataActions

    ------------------------------
    Eric Sisler
    ------------------------------


  • 2.  RE: Translation map for array

    Posted 10-09-2025 16:31

    I find it best to shape the translationMap based upon the JSON return seen in the Execute portion of a Test.

    In the translationMap you need to map each of the fields within the array, not the array as a whole...

    Something like (depending on the JSON)

      "translationMap": {
        "id""$.tickets[0].id"
        "ticketUid": "$tickets[0].Uid"
      }
    That's presuming you only want the first set of entries in the array


    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME
    Technical Adoption Champion
    Genesys
    2024 Community Member of the Year
    ------------------------------



  • 3.  RE: Translation map for array

    Posted 10-10-2025 11:59

    Another example, Eric, where I don't know how many entries are in the array and I want to bring back all of them. A Queue Observation Query in GC

    First the return from the Execute section of Test. Note that it is an array nested within another array, so I have to designate which instance of the outer array to use.

    {
      "systemToOrganizationMappings": {
        "AVAILABLE": [
          "6a3af858-942f-489d-9700-5f9bcdcdae9b"
        ],
        "OFFLINE": [
          "ccf3c10a-aa2c-4845-8e8d-f59fa48c58e5"
        ]
      },
      "results": [
        {
          "group": {
            "queueId": "86141655-2978-4b9e-8897-0677dc07b742"
          },
          "data": [
            {
              "metric": "oUserPresences",
              "qualifier": "6a3af858-942f-489d-9700-5f9bcdcdae9b",
              "stats": {
                "count": 1
              }
            },
            {
              "metric": "oUserPresences",
              "qualifier": "ccf3c10a-aa2c-4845-8e8d-f59fa48c58e5",
              "stats": {
                "count": 12
              }
            }
          ]
        }
      ]
    }

    Then the associated Translation Map, etc.

    {
      "translationMap": {
        "statuses": "$.results[0].data..qualifier",
        "counts": "$.results[0].data..stats.count"
      },
      "translationMapDefaults": {
        "statuses": "[\"Error\"]",
        "counts": "[0]"
      },
      "successTemplate": "{\"counts\": ${counts}, \"statuses\": ${statuses}}"
    }


    ------------------------------
    George Ganahl GCCX-AI, GCP, GCSME
    Technical Adoption Champion
    Genesys
    2024 Community Member of the Year
    ------------------------------



  • 4.  RE: Translation map for array

    Posted 10-10-2025 12:40

    Much appreciated George! I think I may have gotten it right, I ended up with this;

    {
      "type": "object",
      "properties": {
        "ticket": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer"
            },
            "ticketUid": {
              "type": "integer"
            },
            "status": {
              "type": "string"
            },
            "shortDescription": {
              "type": "string"
            },
            "employee": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "firstName": {
                  "type": "string"
                },
                "lastName": {
                  "type": "string"
                }
              }
            },
            "requester": {
              "type": "object",
              "properties": {
                "firstName": {
                  "type": "string"
                },
                "lastName": {
                  "type": "string"
                }
              }
            },
            "company": {
              "type": "string"
            },
            "service": {
              "type": "string"
            },
            "grouping": {
              "type": "string"
            },
            "currentAgent": {
              "type": "object",
              "properties": {
                "firstName": {
                  "type": "string"
                },
                "lastName": {
                  "type": "string"
                }
              }
            },
            "creationDateTime": {
              "type": "string"
            },
            "dueDate": {
              "type": "string"
            },
            "lastUpdate": {
              "type": "string"
            }
          }
        }
      }
    }
    In the "Test" window, I get this (but with all the values I specified)
    In the "Apply Output Transformation" drop down I see this (along with 36 other records in the array), so I think I'm good? The following steps also resolved as "true" (validating output and flattening).
          "lastUpdate": "2025-10-09T12:36:47.0711Z",
          "id": 10485824,
          "ticketUid": 8151858413632,
          "creationDateTime": "2025-06-16T12:14:23Z",
          "dueDate": "2025-06-18T12:14:23Z",
          "status": "Open",
          "statusName": "Open",
          "statusNameInEnglish": "Open",
          "securityQuestions": 0,
          "flag": "FlagNoFlagged",
          "type": "External",
          "companySkillId": 56150,
          "company": {
            "id": 0,
            "name": "Auto One Alight Premier CA",
            "organisationId": 0,
            "skillId": 0,
            "newModel": true,
            "templateCompanyId": 0,
            "ticketCreationEnabled": false,
            "enabledForFreeEmployeeCreation": false,
            "cmsModel": "NotCms",
            "newUx": false
          },
          "serviceSkillId": 55800,
          "service": {
            "id": 55800,
            "name": "Financial Health",
            "skillId": 55800,
            "serviceGroupId": 0,
            "isValidForInteraction": false,
            "enableDynamicDueDate": false,
            "dateModified": "0001-01-01T00:00:00Z",
            "isHrSensitiveData": false,
            "mustBeChangedOnFirstUpdate": false,
            "useDocumentTypes": false,
            "isObsolete": false,
            "isNewModel": false,
            "enabledForFreeEmployeeCreation": false
          },
          "groupingSkill": {
            "id": 52199,
            "ticketUid": 0,
            "name": "Provider-Advisory",
            "skillTypeId": 0,
            "skillTypeName": "Service Process",
            "isAgentSkill": true,
            "isValidForInteraction": false,
            "poolMandatory": false,
            "isObsolete": false
          },
          "shortDescription": "test",
          "employeeId": "646c717ffa16456e299ba778",
          "employee": {
            "id": "646c717ffa16456e299ba778",
            "firstName": "Test 39",
            "lastName": "CH T",
            "backendType": "Sap",
            "backendHandleInbox": false,
            "freelyCreated": false,
            "proxyType": 0
          },
          "requesterId": "646c717ffa16456e299ba778",
          "requester": {
            "id": "646c717ffa16456e299ba778",
            "firstName": "Test 39",
            "lastName": "CH T",
            "company": {
              "id": 0,
              "name": "Auto One Alight Premier CA",
              "organisationId": 0,
              "skillId": 0,
              "newModel": false,
              "templateCompanyId": 0,
              "ticketCreationEnabled": false,
              "enabledForFreeEmployeeCreation": false,
              "cmsModel": "NotCms",
              "newUx": false
            },
            "backendType": "Sap",
            "backendHandleInbox": false,
            "freelyCreated": false,
            "proxyType": 0
          },
          "currentAgent": {
            "id": 13943,
            "firstName": "ast_qa",
            "lastName": "agent_fulladm2",
            "isSpecialAgent": false,
            "createTicketWithStatusNew": false,
            "entityId": 0,
            "status": "None",
            "enableBulkFtr": false,
            "privacyAccessLevelId": 0
          },
          "creatorAgentId": 0,
          "unflaggableByOther": false,
          "solved": false,
          "isLinkedTicket": false,
          "isDueDateDynamicSet": false,
          "opmSkillId": 0,
          "buttons": "None",
          "isInteraction": false,
          "isNew": false,
          "isPending": false,
          "csatDuedate": "2025-06-23T12:14:23Z",
          "pendingType": "None",
          "trimmedDescription": "test",
          "reclassifiedAfterClosure": false,
          "reclassifiedInSLAAfterClosure": false,
          "reviewCompleted": false,
          "newModel": true,
          "estimatedWorkingTime": 0,
          "isVipEmployee": false,
          "isVipRequester": false,
          "hasTaskWithLongerDueDate": false,
          "sourceSkillId": 0,
          "intentSolutionDegraded": false,
          "intentUsage": 0,
          "cmsModel": "NotCms",
          "shouldReclassifyOnTakeOwnership": false,
          "hasSnowTicket": false,
          "hasObsoleteClassification": false,
          "isVisibleToOtherEntity": false,
          "isAutoTranslate": false,
          "lastPendingReasonComment": "",
          "isArchived": false,
          "hasAiProposedSolution": 0
        },


    ------------------------------
    Eric Sisler
    ------------------------------



  • 5.  RE: Translation map for array

    Posted 10-10-2025 01:26

    Hello,

    Could you please show an example of the API response you get from your CRM (hiding confidential/personal info)?

    The name of your property - "ticketUid" - and its declared type - "integer" - make me wonder if it is correct (same for "id").

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------



  • 6.  RE: Translation map for array

    Posted 10-10-2025 12:44

    Hey Jerome, thanks for the response. I think I figured it out, but here's a copy of the response if you have some additional insight. Much appreciated!

          "lastUpdate": "2025-10-09T12:36:47.0711Z",
          "id": 10485824,
          "ticketUid": 8151858413632,
          "creationDateTime": "2025-06-16T12:14:23Z",
          "dueDate": "2025-06-18T12:14:23Z",
          "status": "Open",
          "statusName": "Open",
          "statusNameInEnglish": "Open",
          "securityQuestions": 0,
          "flag": "FlagNoFlagged",
          "type": "External",
          "companySkillId": 56150,
          "company": {
            "id": 0,
            "name": "Auto One Alight Premier CA",
            "organisationId": 0,
            "skillId": 0,
            "newModel": true,
            "templateCompanyId": 0,
            "ticketCreationEnabled": false,
            "enabledForFreeEmployeeCreation": false,
            "cmsModel": "NotCms",
            "newUx": false
          },
          "serviceSkillId": 55800,
          "service": {
            "id": 55800,
            "name": "Financial Health",
            "skillId": 55800,
            "serviceGroupId": 0,
            "isValidForInteraction": false,
            "enableDynamicDueDate": false,
            "dateModified": "0001-01-01T00:00:00Z",
            "isHrSensitiveData": false,
            "mustBeChangedOnFirstUpdate": false,
            "useDocumentTypes": false,
            "isObsolete": false,
            "isNewModel": false,
            "enabledForFreeEmployeeCreation": false
          },
          "groupingSkill": {
            "id": 52199,
            "ticketUid": 0,
            "name": "Provider-Advisory",
            "skillTypeId": 0,
            "skillTypeName": "Service Process",
            "isAgentSkill": true,
            "isValidForInteraction": false,
            "poolMandatory": false,
            "isObsolete": false
          },
          "shortDescription": "test",
          "employeeId": "646c717ffa16456e299ba778",
          "employee": {
            "id": "646c717ffa16456e299ba778",
            "firstName": "Test 39",
            "lastName": "CH T",
            "backendType": "Sap",
            "backendHandleInbox": false,
            "freelyCreated": false,
            "proxyType": 0
          },
          "requesterId": "646c717ffa16456e299ba778",
          "requester": {
            "id": "646c717ffa16456e299ba778",
            "firstName": "Test 39",
            "lastName": "CH T",
            "company": {
              "id": 0,
              "name": "Auto One Alight Premier CA",
              "organisationId": 0,
              "skillId": 0,
              "newModel": false,
              "templateCompanyId": 0,
              "ticketCreationEnabled": false,
              "enabledForFreeEmployeeCreation": false,
              "cmsModel": "NotCms",
              "newUx": false
            },
            "backendType": "Sap",
            "backendHandleInbox": false,
            "freelyCreated": false,
            "proxyType": 0
          },
          "currentAgent": {
            "id": 13943,
            "firstName": "ast_qa",
            "lastName": "agent_fulladm2",
            "isSpecialAgent": false,
            "createTicketWithStatusNew": false,
            "entityId": 0,
            "status": "None",
            "enableBulkFtr": false,
            "privacyAccessLevelId": 0
          },
          "creatorAgentId": 0,
          "unflaggableByOther": false,
          "solved": false,
          "isLinkedTicket": false,
          "isDueDateDynamicSet": false,
          "opmSkillId": 0,
          "buttons": "None",
          "isInteraction": false,
          "isNew": false,
          "isPending": false,
          "csatDuedate": "2025-06-23T12:14:23Z",
          "pendingType": "None",
          "trimmedDescription": "test",
          "reclassifiedAfterClosure": false,
          "reclassifiedInSLAAfterClosure": false,
          "reviewCompleted": false,
          "newModel": true,
          "estimatedWorkingTime": 0,
          "isVipEmployee": false,
          "isVipRequester": false,
          "hasTaskWithLongerDueDate": false,
          "sourceSkillId": 0,
          "intentSolutionDegraded": false,
          "intentUsage": 0,
          "cmsModel": "NotCms",
          "shouldReclassifyOnTakeOwnership": false,
          "hasSnowTicket": false,
          "hasObsoleteClassification": false,
          "isVisibleToOtherEntity": false,
          "isAutoTranslate": false,
          "lastPendingReasonComment": "",
          "isArchived": false,
          "hasAiProposedSolution": 0
        },



    ------------------------------
    Eric Sisler
    ------------------------------