Legacy Dev Forum Posts

 View Only

Sign Up

Data Action Translation Help Needed

  • 1.  Data Action Translation Help Needed

    Posted 06-05-2025 18:43

    Maurice_Ford1 | 2022-02-01 16:55:37 UTC | #1

    Hello,

    I'm having issues translating the results from a data action for use in my architect flow. When referencing the variables in the data action, they're returning blank results.

    Here is my output contract:

    { "title": "customerInformation", "type": "object", "properties": { "selectedProduct.daysPastDue": { "type": "array", "items": { "title": "Item 1", "type": "integer" } }, "selectedProduct.accountId": { "type": "array", "items": { "title": "Item 1", "type": "string" } }, "selectedProduct.productType": { "type": "array", "items": { "title": "Item 1", "type": "string" } }, "products": { "type": "array" } }, "additionalProperties": true }

    Here is my response:

    { "translationMap": { "selectedProduct": "$..selectedProduct", "selectedProduct.daysPastDue": "$[selectedProduct.daysPastDue]", "selectedProduct.accountId": "$[selectedProduct.accountId]", "selectedProduct.productType": "$[selectedProduct.productType]", "products": "$[products]" }, "translationMapDefaults": { "selectedProduct": "[]", "selectedProduct.daysPastDue": "[]", "selectedProduct.accountId": "[]", "selectedProduct.productType": "[]", "products": "[]" }, "successTemplate": "{ \"products\": ${products}, \"selectedProduct\": ${selectedProduct}}" }

    Here's an example of the response received:

    { "selectedProduct.daysPastDue": [ 99 ], "selectedProduct.accountId": [ 987654321 ], "selectedProduct.productType": [ "AIRLINES" ], "products": [ [ { "daysPastDue": 99, "productType": "AIRLINES", "accountId": 987654321 } ] ] }

    Ideally, I'd like to be able to be able to use each of the returned items as a variable within an architect flow.

    Any guidance would be greatly appreciated.

    Best, Mo


    Jason_Mathison | 2022-02-04 13:41:49 UTC | #2

    HI Maurice_Ford1,

    Can you give an example of what your endpoint is returning (replacing anything sensitive with other text)? This is the output of the "execute" step in test mode.

    It looks like you are trying to flatten the response yourself in the translationmap. If the response from your endpoint is reasonably simple you can often not have any translation map at all, and instead model that response in your output template. The final flattening (linking things together with '.'s) will happen automatically for you.

    --Jason


    Maurice_Ford1 | 2022-02-04 15:25:56 UTC | #3

    Hi Jason,

    My "response received" example was actually what the endpoint is returning. I figured out what the issue was. My successTemplate didn't correctly match my output contract.


    system | 2022-03-07 15:26:09 UTC | #4

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