Legacy Dev Forum Posts

 View Only

Sign Up

Does object named properties conflict with contract output?

  • 1.  Does object named properties conflict with contract output?

    Posted 06-05-2025 18:44

    CamiloVacaHernande | 2023-01-26 23:00:48 UTC | #1

    Hi all,

    I have a query, I hope you can help me since I have not found information about it.

    Inside the association of my response (output) is my JSON:

    { "full": 1, "results": [ { "id": "xx", "properties": { "createdate": "xxxx-xx-xxT18:12:35.647Z", "email": "xx@xxx.com", "firstname": "xxx", "hsobjectid": "xxx", "lastmodifieddate": "xxxx-xx-xxT18:12:35.647Z", "lastname": "xxxx" }, "createdAt": "2022-03-30T20:16:19.625Z", "updatedAt": "2023-01-16T18:12:35.647Z", "archived": false } ] }

    and the contract my output is:

    output: { "successSchema": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "properties": { "type": "object", "properties": { "email": { "type": "string" } }, "additionalProperties": true } }, "additionalProperties": true } } }, "additionalProperties": true } }

    The response is OK, but the result of the information does not show it. Is it possible that because the object has name properties, the result is not displayed?

    Thanks in advance!

    Integrations

    Regards.

    Camilo


    Jason_Mathison | 2023-01-26 23:25:44 UTC | #2

    Hi Camilo,

    I reproduced the issue, but I am not quite sure if it is a bug or a limitation of "flattening" the object. Please open a support case so that this can be researched / prioritized / fixed.

    --Jason


    CamiloVacaHernande | 2023-01-27 12:43:45 UTC | #3

    Thanks Jason, I appreciate your answer


    Jerome.Saint-Marc | 2023-01-27 13:35:06 UTC | #4

    Hello,

    As a note, if you are trying to retrieve only the list/array of emails from your result, you can also use the following to avoid the issue with "properties" attribute name.

    Your Output Contract can be set like this:

    { "type": "object", "properties": { "emailList": { "type": "array", "items": { "title": "Item 1", "type": "string" } } }, "additionalProperties": true }

    And your Response Configuration like this:

    { "translationMap": { "values": "$.results[*].properties.email" }, "translationMapDefaults": { "values": "[]" }, "successTemplate": "{ \"emailList\": ${values} }" }

    Regards,


    Jason_Mathison | 2023-01-27 14:00:22 UTC | #5

    I am starting to think that this is a bug in the test mode UI, not in the actual data action behavior. Could you see if your action works correctly in the end tool, like architect?

    --Jason


    Jason_Mathison | 2023-01-27 14:37:11 UTC | #6

    So this is a known issue, PCADMIN-7745. The test UI doesn't correctly handle having an object named "properties" in the results. I expect that means that your action was working, just not showing correct results in test mode. I noted that another customer had run into this issue on the ticket.

    --Jason


    CamiloVacaHernande | 2023-01-27 17:23:32 UTC | #7

    Hi Jason, I have used the data action in architect but the output variables of the action do not appear


    Jason_Mathison | 2023-01-30 06:26:19 UTC | #8

    Thank you for letting me know that this is also an issue with Architect, that got me to look in the right direction and find the underlying problem. I have opened up a ticket for an issue in the backend service, BPIVR-2719.

    In order to get your data action working I would recommend going with Jerome's approach to avoid having a "properties" object inside of your output schema.

    --Jason


    Jason_Mathison | 2023-02-06 17:07:04 UTC | #9

    I just merged in a fix for this issue. Unless we run into any issues it should be deployed globally in the next couple of weeks.

    Thank you for reporting this issue!

    --Jason


    system | 2023-03-09 17:07:26 UTC | #10

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