Transformers

post/api/transformers/test

Request body

Example request

{
  "transformer": {
    "inputType": "string",
    "outputType": "number",
    "name": "String to Number",
    "description": "Converts string input to numeric output",
    "customCode": "function transform(input) { return parseFloat(input); }",
    "customManifest": {
      "key": "serverUrl",
      "translationKey": "connection.serverUrl",
      "validators": [
        {
          "arguments": []
        }
      ],
      "attributes": [
        {
          "key": "serverUrl",
          "translationKey": "connection.serverUrl",
          "validators": [
            {
              "arguments": []
            }
          ],
          "displayProperties": {
            "row": 1,
            "columns": 6,
            "displayInViewMode": true
          },
          "defaultValue": "oibus-client"
        }
      ],
      "enablingConditions": [
        {
          "targetPathFromRoot": "protocol",
          "referralPathFromRoot": "connection.type",
          "values": [
            "MQTT"
          ],
          "operator": "EQUALS"
        }
      ],
      "displayProperties": {
        "visible": true,
        "wrapInBox": true
      }
    },
    "timeout": 2000
  }
}

Response

Ok

outputstring required

Changes