Data Action - Unexpected JSONPath evaluation failure

Right, the contact.customFields.billing.address.street JSONPath is failing in a data action, but only when the billing.address array has more than one element. It’s returning null instead of the first element’s street value. Honestly, I’ve checked the input schema a dozen times and it’s valid - the billing.address field is always an array of objects, each with a street property. Not 100% sure but this feels like a regression in the JSONPath engine; the docs don’t mention array length limitations.

Here’s what’s been tried:

  • Data action SDK version: es_next
  • Architect flow version: 1.23.4
  • Target API: /api/v2/users/{userId}/dataactions
  • Input JSON (truncated):
{
"contact": {
"customFields": {
"billing": {
"address": [
{ "street": "123 Main St", "city": "Anytown" },
{ "street": "456 Oak Ave", "city": "Otherville" }
]
}
}
}
}
  • JSONPath expression: contact.customFields.billing.address[0].street - returns “123 Main St” consistently.
  • JSONPath expression: contact.customFields.billing.address[1].street - returns “456 Oak Ave” consistently.
  • JSONPath expression: contact.customFields.billing.address[*].street - returns ["123 Main St", "456 Oak Ave"] consistently.
  • The problem is when attempting to resolve contact.customFields.billing.address.street - the entire value is discarded and it returns null.

The flow is a simple data action triggered on a message received event - the input is a standard contact record, tbh. The data action’s purpose is to extract the street address for a custom header. We’ve verified that the input contact record always has the billing.address array populated. It’s baffling.

1 Like

The issue’s likely the JSONPath engine’s handling of arrays - it’s not uncommon to see this with regulatory data. Specifically, MiFID II requires complete recording data, so incomplete address fields are a red flag.

Instead of contact.customFields.billing.address.street, try contact.customFields.billing.address[0].street. This explicitly requests the street property of the first element in the billing.address array.

Seen similar behavior with data actions in the past - the earlier reply correctly identified potential schema issues, but this is a common edge case. Ensure the data action’s error handling is configured to log failures when the JSONPath evaluates to null - vital for audit trails. Consider a default value if the street field is legitimately missing, but document the reason. Don’t assume the data is clean.

Fun one today; that JSONPath is brittle. It’s assuming an index; predictable, sure, but what happens when billing.address is empty? Null propagates; everything breaks.

Try this - slightly longer, admittedly - contact.customFields.billing.address[0]?.street. The ? handles the null case; avoids the whole cascade failing; less headache. It’s a band-aid, sure, but we’ve all got quotas to hit.

That [0]?.street suggestion - yeah, that did it. Honestly didn’t even think to handle the empty array case, just assumed the data would always be there - my bad. It’s propagating null now instead of crashing the whole action, which is fine, we can handle that upstream. tbh, feels like a workaround for a bad schema, but it’s shipping.