So what I finally ended up doing was below. It takes either the defined activitymap.regionIDAtttribute or uses "region_id". If it can't find either of those and hit 'id' first it uses that. All else fails it returns 'body' e.region = function (a) { for (var d, b = e.regionIDAttribute || "region_...