Data Action external REST call mapping nested JSON to Architect variables

Hey everyone, I’ve run into a really strange issue with mapping nested JSON responses in a Data Action.

The Data Action calls an external endpoint https://api.internal.com/v1/status and returns 200 OK with payload {"data": {"code": 200, "msg": "ok"}}. The mapping configuration specifies "data.code" as the source for output variable responseCode. The execution logs show the HTTP request succeeds, but the variable responseCode remains null in the subsequent block.

Is the genesyscloud data action parser strictly flat, requiring explicit path traversal syntax like data->code, or is there a known issue with dot notation in the JSONPath expression?

This is a known limitation with how Architect handles nested JSON from Data Actions. Static mappings can be unreliable with dynamic responses.

Since responseCode remains null despite a successful request, try using a Scripting block to parse the JSON first. Access the response body via $request.body and then navigate the structure using standard JavaScript: JSON.parse($request.body).data.code. This approach reliably extracts nested values.

2 Likes