Arrays in Data Action Not Showing Outputs in Architect Flow

I'm only able to see the inputs of a data action in Architect when the response includes arrays. This is what the data action looks like:

I've tried two different variations of the Response, but in either case, there are no output parameters shown in Architect.


  1. How do I get the output parameters to show up in Architect?
  2. Is Architect capable of settings all of those output parameters to a single JSON that I can use within the inbound flow?

Data Actions don't handle hierarchical nested arrays like that very well. I would suggest that your output contact just have a single object that is returned to Architect as a JSON object and then you can use expressions in Architect to query into the JSON object as necessary.

Problem 1:

Since arrays are not supported in this scenario, I'll return a single JSON object. This is my data action now. However, the output parameter is still not showing up, even after refreshing.

Do I need to change the response to something else to get the output parameters to show?

Problem 2:

I also created a JSON variable that will take the output parameter. It looks like this:

image

  {
    "String1": "foo1",
    "String2": "bar1",
    "ChildArray": [
      { "StringA": "baz1", "StringB": "qux1" },
      { "StringA": "quux1", "StringB": "lorem ipsum1" }
    ],
    "String3": "abc1",
    "String4": "def1"
  }

I know how to predefine a JSON ahead of time with values, but once I get the new values from the data action, I don't know how to change the fields in my JSON to become the new values of the data action's output object. You suggested using expressions, which I've tried before but with no success. Could you please provide me with an example on how to modify one of the fields I have for my TestJson variable that I created in Architect?

Hi Michael,

First, I think you need to put the response template back to the default so that the entire "rawResult", which should just be your full JSON object, is the thing that is returned to the output contact object named "JSONObject". Like this:

{
  "translationMap": {},
  "translationMapDefaults": {},
  "successTemplate": "${rawResult}"
}

Then in Architect in the block were you are making an assignment to your variable in the "Value to Assign 11" field change that to an "Expression" and in the Expression Editor you can use the JSON functions to pull values out of the JSON object. Click the "f(x)' button and search for "json" and you'll see all of the JSON functions available to you within the expression builder.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.