Skip to content

Translate Processor

Refael Mizrahi edited this page Jun 29, 2022 · 5 revisions

Translate [translate]

This processor allows you to check the value of a field and then add an additional field or overwrite the original field with a new value. It's a good processor for translating status codes to actual human-readable values.

  • field (String values only!)
  • targetField
  • fallback (optional)
  • dictionary [this is a json object with key:values where the key is the original value, and the value is what you want to replace it with] EG

Example

{
  "steps": [{
    "translate": {
      "config": {
        "field": "deviceTypeId",
        "targetField": "deviceType",
        "fallback": "UNKNOWN",
        "dictionary": {
          "0": "Unknown",
          "1": "Windows",
          "2": "Mac",
          "3": "Windows",
          "256": "Home Gateway",
          "257": "Home Gateway",
          "258": "Home Gateway",
          "272": "Home Gateway",
          "273": "Home Gateway",
          "274": "Home Gateway",
          "320": "STB",
          "321": "STB",
          "322": "STB",
          "352": "STB",
          "353": "STB",
          "768": "iOS Phone",
          "832": "iOS PMP",
          "896": "iOS Tablet",
          "1024": "Android Phone",
          "1152": "Android Tablet",
          "1280": "Windows 8 Phone",
          "1297": "Windows 8 Metro",
          "1298": "Windows 8 Metro",
          "1536": "Connected TV",
          "1792": "PS3",
          "2048": "XBOX",
          "2304": "PS3",
          "2305": "PS4",
          "2384": "Roku",
          "2385": "Chromecast",
          "2416": "AMLogic Dongle"
        }
      }
    }
  }]
}
Clone this wiki locally