# How to use processingMode in Smart Function / Dynamic Mapper

**URL:** <https://community.cumulocity.com/t/how-to-use-processingmode-in-smart-function-dynamic-mapper/15011>\
**Category:** Forum\
**Tags:** smart-functions, dynamic-mapper, device-management, cumulocity\
**Created:** [July 10, 2026, 7:52am UTC](https://community.cumulocity.com/t/how-to-use-processingmode-in-smart-function-dynamic-mapper/15011 "2026-07-10T07:52:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![v.reschke](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/v.reschke/32/32057_2.png) [@v.reschke](https://community.cumulocity.com/u/v.reschke)\
**Post date:** [July 10, 2026, 7:52am UTC](https://community.cumulocity.com/t/how-to-use-processingmode-in-smart-function-dynamic-mapper/15011/1 "2026-07-10T07:52:43Z")

</div>

Hi everyone,

I’m trying to send measurement data in Cumulocity in TRANSIENT mode via a Smart Function in the Dynamic Mapper, so that the data is processed by Streaming Analytics but no measurement is stored in the database.

In my Smart Function, I currently push results like this:

```auto
return [{
  cumulocityType: "measurement",
  action: "create",
  payload: {
    "time": measuredAt,
    "type": "mqtt-measurement",
    "processingMode": "TRANSIENT",
    "mqtt-measurement": {
      "BatteryVoltage": {
        "unit": "V",
        "value": payload["data"]["a_batteryVoltage"]
      }
    }
  },
  externalSource: [
    { "type": "c8y_Serial", "externalId": payload["device_id"] }
  ]
});

```

The `processingMode` field is visible in the created measurement:

```auto
json{
  "id": "4610994",
  "type": "mqtt-measurement",
  "time": "2026-07-09T12:00:06.142Z",
  "processingMode": "TRANSIENT",
  "mqtt-measurement": {
    "BatteryVoltage": {
      "unit": "V",
      "value": 3.77
    }
  }
}

```

However, the measurement is still persisted in the database, so the TRANSIENT mode does not seem to have any effect in this case.

When I use a JSONata mapping instead, it works as expected and no measurement is stored. The working JSON looks like this:

```auto
json{
  "time": "2026-07-09T08:14:49.389+02:00",
  "type": "mqtt-measurement",
  "_IDENTITY_": {
    "externalId": "any_SerialNumber"
  },
  "_CONTEXT_DATA_": {
    "api": "MEASUREMENT",
    "processingMode": "TRANSIENT",
    "deviceName": "generatedDevice",
    "deviceType": "c8y_MQTTDevice"
  }
}

```

How should the payload be structured in a Smart Function / Dynamic Mapper so that `processingMode = TRANSIENT` is actually respected and no measurement is stored?

Any examples or best practices would be really appreciated.

Kind regards

Valerian

---

<div class="post-metadata">

**Author:** ![Stefan\_Witschel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/stefan_witschel/32/31955_2.png) [@Stefan\_Witschel](https://community.cumulocity.com/u/Stefan_Witschel)\
**Post date:** [July 10, 2026, 9:08am UTC](https://community.cumulocity.com/t/how-to-use-processingmode-in-smart-function-dynamic-mapper/15011/2 "2026-07-10T09:08:51Z")

</div>

Hi Valerian,

the documentation might be improvable but the following should work:

```auto
return [{
  cumulocityType: "measurement",
  action: "create",
  payload: {
    "time": measuredAt,
    "type": "mqtt-measurement",
    "mqtt-measurement": {
      "BatteryVoltage": {
        "unit": "V",
        "value": payload["data"]["a_batteryVoltage"]
      }
    }
  },
  externalSource: [
    { "type": "c8y_Serial", "externalId": payload["device_id"] }
  ],
  contextData: {
     processingMode: "TRANSIENT"
  }
}];

```

Here are all options of contextData:

```auto
    contextData?: {
        /** Display name of the implicitly created device */
        deviceName?: string;
        /** Managed object type of the implicitly created device */
        deviceType?: string;
        /** Processing mode: "PERSISTENT" (default) or "TRANSIENT" */
        processingMode?: "PERSISTENT" | "TRANSIENT";
        /** Additional fragments merged into the device MO on first creation */
        deviceFragments?: Record<string, any>;
        /** Group names the device is added to as a child asset (created if missing) */
        deviceGroups?: string[];
        /** Binary attachment fields for EVENT types */
        attachmentName?: string;
        attachmentType?: string;
        attachmentData?: string; // Base64-encoded
    };

```

It is part of the built-in documentation but hard to find as it is Transformation Type → Smart Function.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/9/7/97425e6c108cd9682ada2a13841ad3335b160584.jpeg)

---

<div class="post-metadata">

**Author:** ![v.reschke](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/v.reschke/32/32057_2.png) [@v.reschke](https://community.cumulocity.com/u/v.reschke)\
**Post date:** [July 10, 2026, 9:40am UTC](https://community.cumulocity.com/t/how-to-use-processingmode-in-smart-function-dynamic-mapper/15011/3 "2026-07-10T09:40:01Z")

</div>

Hi Stefan,  
thanks for the information, that’s very helpful. I checked the Cumulocity documentation but didn’t find anything. I didn’t consider that the solution might be in the built‑in documentation. It might be beneficial to have all the documentation available in a central place.

I’ll test this a bit and then give feedback on whether it worked. Since it’s documented this way, I don’t see any reason why it shouldn’t work. Thanks again for your reply and the information provided.
