Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Help with Data Action

    Posted 06-05-2025 18:43

    jheckbert | 2022-09-30 15:51:26 UTC | #1

    Hi,

    I am new to Data Actions and looking for some guidance.

    I am using the GET /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId} API in my data action. When I run it in API explorer with a contactlist ID and a Contact ID I get a 200 success with this output. (Phone number masked)

    { "id": "6c945588896ba90e8c6e78bc0f748b97", "contactListId": "1a0983e6-8127-4b45-a1a5-c8f0ac0b2064", "data": { "LastName": "Brown", "FirstName": "Henry", "CTN": "1XXXXXXXXXX" }, "callRecords": { "CTN": { "lastAttempt": "2022-09-30T15:29:01.446Z", "lastResult": "7fb334b0-0e9e-11e4-9191-0800200c9a66" } }, "callable": true, "phoneNumberStatus": { "CTN": { "callable": true } }, "contactableStatus": { "Email": { "contactable": true } }, "selfUri": "/api/v2/outbound/contactlists/1a0983e6-8127-4b45-a1a5-c8f0ac0b2064/contacts/6c945588896ba90e8c6e78bc0f748b97" }

    This is the schema I have setup in the data action

    This is the response: (I have tried at least 10 different ways on this and still not able to get this to work.)

    When I test it I receive this message: { "message": "Transform failed to process result using 'successTemplate' template due to error:'Variable $data has not been set at successTemplate[line 2, column 22]'\n Template:'{\n\t\"LastName\": ${data.LastName},\n \n\t\"FirstName\": ${Data.FirstName},\n \n\t\"CTN\": ${data.CTN}\n}}'.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "fa8cec10-4a4e-4c96-8fdf-0ad60824c90c", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [] }

    Wondering if any of you kind souls could give me some guidance.


    Jerome.Saint-Marc | 2022-10-04 14:18:07 UTC | #2

    Hello,

    As you have named your Response parameters dataLastName, dataFirstName, data_CTN in your Output Contract, your Response configuration should look like this:

    { "translationMap": { "LastName": "$.data.LastName", "FirstName": "$.data.FirstName", "CTN": "$.data.CTN" }, "translationMapDefaults": { "LastName": "\"\"", "FirstName": "\"\"", "CTN": "\"\"" }, "successTemplate": "{ \"dataLastName\": ${LastName}, \"dataFirstName\": ${FirstName}, \"data_CTN\": ${CTN}}" }

    Note that I also corrected LASTNAME/FIRSTNAME in your translationMap.

    Regards,


    jheckbert | 2022-09-30 16:59:58 UTC | #3

    jheckbert, post:1, topic:16543
    6c945588896ba90e8c6e78bc0f748b97

    Thank you very much! This worked perfectly!! Much appreciated :smiley:


    Ebenezer_Osei | 2022-10-04 14:29:18 UTC | #4


    This post was migrated from the old Developer Forum.

    ref: 16543