Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Error data action

    Posted 06-05-2025 18:41

    db97f7fa835dbf12c5ab | 2020-03-06 11:44:16 UTC | #1

    Action custom-92476097-4026-4c3c-bdfc-3cb6b2b2ca76 failed validation. Errors: [Failed Validation of contract.input.inputSchema as a simple properties schema. Must be an Object with properties and no sub-objects. JSON failed schema validation for the following reasons: Schema: # @/properties/type. Error location: /type. instance value ("array") not found in enum (possible values: ["object"])]


    anon28885283 | 2020-03-06 12:10:06 UTC | #2

    The input for Data Actions should be a flat JSON. If your API needs a nested JSON body, you can modify the requestTemplate

    https://help.mypurecloud.com/articles/request-configuration-data-actions/


    db97f7fa835dbf12c5ab | 2020-03-06 12:19:28 UTC | #3

    On the data action boy, it accepts curl?


    tim.smith | 2020-03-06 14:08:32 UTC | #4

    No, the data action body must be JSON. cURL is a command line tool.


    db97f7fa835dbf12c5ab | 2020-03-09 06:48:41 UTC | #5

    Hello,

    So it is not possible to use curl in data actions? Since this documentation indicates that if..., could you assure me?

    Since we need to perform a PUT to update data and it only allows us to return it in array.

    https://help.mypurecloud.com/articles/request-configuration-data-actions/

    Thank you


    anon28885283 | 2020-03-09 09:38:31 UTC | #6

    The cURL commands you're seeing in that article are just to show you what the HTTP request actually looks like when the Data Action is run.

    You can't put any cURL commands in the body(request template) because those are different things.

    If you want to send your input as values of an array or deep objects then you need to replace the default ${input.rawRequest} with the JSON that your service is expecting and refer to your inputs with input variables.


    db97f7fa835dbf12c5ab | 2020-03-09 09:46:18 UTC | #7

    Hello,

    now the mistake I get is in the successtemplate.

    <a class="attachment" href="/forum/uploads/db6296/original/2X/5/534df6aca893c21cf834e4e15f7afadc8f750d2c.json">AcciondeDatosZoho-PUT-20200309104539.custom.json</a> (1.3 KB)

    Log:

    Operaciones

    1. Validate request body contains simple json (key-value pairs)

    { "Phone": "655101515", "orgId": "c1011b6e-9027-415e-8989-222df70e004e", "integrationId": "6ea2ef2c-328d-49b5-9eba-2e46602b7f4d", "rawRequest": "{\"Phone\":\"655101515\"}" }

    2. Validate draft definition

    { "success": true }

    3. Validate request body against input schema

    { "success": true }

    4. Perform authentication

    { "success": true }

    5. Resolve request URL template

    "[PUT] https://www.zohoapis.eu/crm/v2/contacts/259813000000240025"

    6. Resolve request header templates

    { "Authorization": [ "&lt;REDACTED&gt;" ], "Transfer-Encoding": [ "buffered" ], "Content-Type": [ "application/json" ] }

    7. Resolve request body template

    "{\n \"data\": [\n {\n \"Phone\": \"\",\n \"Email\":\"\"\n }\n ],\n \"trigger\": [\n \"approval\"\n ]\n}"

    8. Execute

    { "data": [ { "code": "SUCCESS", "details": { "ModifiedTime": "2020-03-09T10:44:15+01:00", "ModifiedBy": { "name": "Francisco López", "id": "259813000000192001" }, "CreatedTime": "2020-02-24T13:47:22+01:00", "id": "259813000000240025", "CreatedBy": { "name": "Francisco López", "id": "259813000000192001" } }, "message": "record updated", "status": "success" } ] }

    9. Resolve translation map

    { "rawResult": "{\n \"data\" : [ {\n \"code\" : \"SUCCESS\",\n \"details\" : {\n \"ModifiedTime\" : \"2020-03-09T10:44:15+01:00\",\n \"ModifiedBy\" : {\n \"name\" : \"Francisco López\",\n \"id\" : \"259813000000192001\"\n },\n \"CreatedTime\" : \"2020-02-24T13:47:22+01:00\",\n \"id\" : \"259813000000240025\",\n \"CreatedBy\" : {\n \"name\" : \"Francisco López\",\n \"id\" : \"259813000000192001\"\n }\n },\n \"message\" : \"record updated\",\n \"status\" : \"success\"\n } ]\n}" }

    10. Apply output transformation

    { "message": "Transform failed to process result using 'successTemplate' template due to error:'Variable $Phone has not been set at successTemplate[line 1, column 11]'\n Template:'{\"Phone\": ${Phone}'.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "558311c4-71bb-473d-8748-f5becef26595", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [] }


    db97f7fa835dbf12c5ab | 2020-03-09 14:25:44 UTC | #8

    I already got the data updated in CRM from the data action test area. But now when I want to apply it in the script, it performs the data action, but the data is not updated, you know why? Is there any incidence in the script?

    Is there something wrong with the data action so that it does not work from the script?

    <a class="attachment" href="/forum/uploads/db6296/original/2X/1/1d8b085ffb0cfe5f14b119392d4b138d1ca5117b.json">AcciondeDatosZoho-PUT-20200309152507.custom.json</a> (1.6 KB)

    Thnks.


    system | 2020-04-09 13:52:13 UTC | #9

    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: 7288