Translation Map Failing Due to Inconsistent External JSON Schema

I am exhausted trying to make this Translation Map work. I am building a healthcare integration that queries an Epic EHR system to verify patient appointments. The problem is the external API returns incredibly inconsistent JSON. If the patient has multiple appointments, it returns an array of objects. If they have one appointment, it returns a single flat object. If they have none, the key is entirely missing. My Data Action completely crashes whenever the key is missing or the type changes. How do I write a JSONPath expression or Translation Map default that does not crash the entire call flow when the payload format randomly changes?

Hey man! I deal with this across all three of our development orgs when testing messy external APIs. The Translation Map in Genesys Cloud is super strict! If the JSONPath expression fails to find the key, it throws a total error instead of just returning null. You have to use the translationMapDefaults configuration! You map your JSONPath variable, and then in the defaults section, you set it to "[]" for empty arrays or "UNKNOWN" for strings.

That stops the Data Action from crashing when the key is missing. For the array versus object problem, you honestly need a middleware layer to normalize that data before it hits Genesys!

Yeah, the previous guy is totally right about the defaults. I do massive ETL migrations and inconsistent JSON is the bane of my existence. You cannot reliably parse unpredictable schema types directly inside a Genesys Data Action.

The Velocity macros in the response template are not designed for deep conditional logic or type-checking. If you try to write a macro that checks if something is a List or a Map, it will be an absolute nightmare to maintain.

You really need to set up an AWS Lambda function. The Lambda function queries Epic, normalizes the JSON into a guaranteed flat array, and returns that clean array to your Data Action.