Legacy Dev Forum Posts

 View Only

Sign Up

Data Action-Translation Maps

  • 1.  Data Action-Translation Maps

    Posted 06-05-2025 19:23

    hanifenur | 2022-11-22 08:35:35 UTC | #1

    Hello, I am working on my integration action information. I am trying to create a custom action by taking id as input and from that I am going to get user info such as avatar and first/last name of the user. INPUT CONTRACT { "$schema": "http://json-schema.org/draft-04/schema#", "title": "User Info Request", "description": "Fields needed in the body of the POST to create a calendar reminder.", "type": "object", "required": [ "id" ], "properties": { "id": { "type": "number" } }, "additionalProperties": true }

    OUTPUT CONTRACT { "$schema": "http://json-schema.org/draft-04/schema#", "title": "data", "description": "", "type": "object", "properties": { "avatar": { "type": "string" }, "firstname": { "type": "string" }, "lastname": { "type": "string" } }, "additionalProperties": true }

    RESPONSE { "translationMap": { "firstname": "$firstname", "lastname": "$lastname", "avatar": "$avatar" }, "translationMapDefaults": {}, "successTemplate": "${rawResult}" }

    When I try to test I got an error which is :

    Resolve translation map: Failed while processing the translation map. Could not resolve value for the key: 'first_name' and no default value was configured. Additional details: Illegal character at position 1 expected '.' or '['

    What I do wrong? I am new at coding. Any help would be appreciated. Sincerely,


    hanifenur | 2022-11-24 13:33:28 UTC | #2

    Actually in the beginning my request URL was wrong. I changed my request url to this --> [https://reqres.in/api/users/${input.id}] Right now While response like below { "translationMap": {}, "translationMapDefaults": {}, "successTemplate": "${rawResult}" } It receives the correct information about the input id I give, without output contracts. The problem is now when I arranged output contracts like this; { "title": "data", "type": "object", "properties": { "firstname": { "type": "string" }, "lastname": { "type": "string" } }, "additionalProperties": true }

    It receives correct json but doesn't fill the output template. I tried to add arrays and firstname : $.firstname kind of solutions however it respond an error or remained the same. Do u have any suggestions? Thank you in advance.


    Jerome.Saint-Marc | 2022-11-24 14:21:33 UTC | #3

    Hello,

    Your Output Contract should be set like this:

    { "type": "object", "properties": { "data": { "type": "object", "properties": { "firstname": { "type": "string" }, "lastname": { "type": "string" } }, "additionalProperties": true } }, "additionalProperties": true }

    Regards,


    hanifenur | 2022-11-24 14:21:59 UTC | #4

    Thank you Jerome. It solved my problem.


    system | 2022-12-25 14:22:00 UTC | #5

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