Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Data Actions - Arrays

    Posted 06-05-2025 18:15

    Pivotal_PS | 2019-10-21 14:41:54 UTC | #1

    Hi

    I call an API that returns an array member. I need to fetch the "name" attribute of the first item in the array

    e.g.

    { "items" : [ { "name" : "bob" }, { "name" : "grant" } ] }

    When testing the action, the json payload is populated correctly, but the test UI does not show the "name"

    Config (note the forum has remove the dollar prefixes)

    { "translationMap": { "name": "$.results[0].name", "total": "$.total" }, "translationMapDefaults": { "name": "\"UNKNOWN\"" }, "successTemplate": "{\n \"name\": ${name},\n \"total\": ${total}}" }

    Test UI showing the JSON is correct. I would expect to see the name and not this results -> name structure

    What am I doing incorrectly?

    thanks


    Jason_Mathison | 2019-10-21 15:06:20 UTC | #2

    A couple of quick things to check... I have seen this type of problem when flattening is turned on, so turning that off can get things to look right. I have also seen running the same test twice populate the UI correctly (event with flattening turned on). Let me know if those two approaches don't get things looking right. I have internal tickets open for these issues, but I don't have any sort of timeline on getting them fixed.

    --Jason


    system | 2019-11-21 15:06:21 UTC | #3

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