Step one: the Studio flow routes the contact through a SNIPPET action to fetch customer tenure data before dropping into the retention queue. The SNIPPET calls the REST Proxy endpoint POST /api/v2/integrations/proxy/customer-tenure, which hits a Data Action wrapping the internal Salesforce endpoint. The Data Action returns a 200, but the SNIPPET action throws INVALID_RESPONSE_MAPPING and kills the flow.
Environment is CXone 24.3 with REST Proxy v5.1. The response payload shifted from a flat object to a nested array structure on the backend side last Tuesday. response.body.data[0].tenure_days is what the mapping targets, but the logs show the SNIPPET action expects a scalar value.
Console is empty on the error details. Just the generic mapping failure. Tried wrapping the response in the Data Action to flatten it, but the SNIPPET action still chokes on the array index. The mapping configuration looks solid:
REST Proxy logs confirm the payload arrives intact, so it’s definitely a parsing issue inside the Studio engine. Switching to a Set Attribute action with a direct REST call doesn’t work since that bypasses the caching layer. The SNIPPET action times out after thirty seconds.
{
"mapping": {
"tenure": "response.body.data[0].tenure_days"
}
}
Check the response structure. The docs state “nested arrays must be flattened for snippet mapping.” If your Salesforce payload returns {{ "data": [ [1, 2], [3, 4] ] }}, the parser chokes. Flatten it first. Use body.data.flat() in the Data Action transform before returning.
The mapping isn’t about flattening, it’s about the schema definition. If the proxy expects a list of objects but gets an array of primitives, it fails validation regardless of depth. Define the response schema explicitly in the proxy config to match the actual JSON structure.
Thanks for the replies. The schema definition suggestion from was definitely part of the puzzle, but the real kicker was how the Data Action was handling the array serialization.
I dug into the Data Action logs and realized the Salesforce endpoint was returning an array of objects, but the Data Action transform was implicitly wrapping that result in another object key {"result": [...]}. The Proxy snippet mapper doesn’t like that extra layer when it expects a direct list.
I updated the Data Action transform to explicitly return the array at the root level. Here’s the transform code that fixed it:
// Data Action Transform
return input.salesforceResponse.records;
// Previously was: return { data: input.salesforceResponse.records };
Once I stripped that wrapper object, the SNIPPET action mapped the tenure field cleanly. It’s still throwing a warning if the array is empty, but at least the flow continues instead of dying with INVALID_RESPONSE_MAPPING.