# How i can create and register custom templates for sending messurmentes in cumulocity iot

**URL:** <https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [March 17, 2022, 9:32am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098 "2022-03-17T09:32:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumit.singh](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sumit.singh](https://community.cumulocity.com/u/sumit.singh)\
**Post date:** [March 17, 2022, 9:32am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/1 "2022-03-17T09:32:20Z")

</div>

how i can create or register custom templates for sending messurmentes in cumulocity iot in nodejs and i am sending cov data like {pointID : 1234e456757fdggfbn6,data:130} i am sending in messurments and i want to see this data in messurments .

---

<div class="post-metadata">

**Author:** ![Christian\_Guether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_guether1/32/14848_2.png) [@Christian\_Guether1](https://community.cumulocity.com/u/Christian_Guether1)\
**Post date:** [March 30, 2022, 7:04am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/2 "2022-03-30T07:04:33Z")

</div>

Hi Sumit,

how do you send those measurements to Cumulocity in nodejs? If it is via MQTT you will find information about custom templates in this [thread](https://community.cumulocity.com/t/i-want-to-register-custom-measurement-templates-via-mqtt/7751/2) and in the official [documentation](https://cumulocity.com/guides/reference/smartrest-two/#request-templates).

In case you are using the REST API, it isn’t required to register any custom templates for sending measurements. You just need to follow the structure for measurements, which is described in the [Cumulocity OpenAPI specification](https://cumulocity.com/api/10.11.0/#operation/postMeasurementCollectionResource).

Best regards  
Christian

---

<div class="post-metadata">

**Author:** ![sumit.singh](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sumit.singh](https://community.cumulocity.com/u/sumit.singh)\
**Post date:** [March 30, 2022, 7:50am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/3 "2022-03-30T07:50:28Z")

</div>

I am doing via mqtt  
Thanks for your support Christian

---

<div class="post-metadata">

**Author:** ![sumit.singh](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sumit.singh](https://community.cumulocity.com/u/sumit.singh)\
**Post date:** [April 20, 2022, 7:15am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/4 "2022-04-20T07:15:06Z")

</div>

hi christian  
can i send string enum data type data on cumulocity meassurment section ,is it possible to send any kind of data can be send custom templates for meassurments if yes then how can i do that help me with steps ?

---

<div class="post-metadata">

**Author:** ![Christian\_Guether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_guether1/32/14848_2.png) [@Christian\_Guether1](https://community.cumulocity.com/u/Christian_Guether1)\
**Post date:** [April 25, 2022, 1:44pm UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/5 "2022-04-25T13:44:13Z")

</div>

Hi Sumit,

please have a look at this [post](https://community.cumulocity.com/t/how-to-visualize-enum-or-string-data-in-cumulocity-cloud/202/3).

Best regards  
Christian

---

<div class="post-metadata">

**Author:** ![sumit.singh](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sumit.singh](https://community.cumulocity.com/u/sumit.singh)\
**Post date:** [May 2, 2022, 5:26am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/6 "2022-05-02T05:26:22Z")

</div>

Hi Christian  
what kind of data we will able to send in event using widget process and how it will look like?

---

<div class="post-metadata">

**Author:** ![Christian\_Guether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_guether1/32/14848_2.png) [@Christian\_Guether1](https://community.cumulocity.com/u/Christian_Guether1)\
**Post date:** [May 3, 2022, 9:56am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/7 "2022-05-03T09:56:26Z")

</div>

Hi Sumit,

to have the [Process Widget](https://github.com/Cumulocity-IoT/cumulocity-processing-widget) pick up your event correctly, you need to define a mapping of the event in the Process widget. For example, you have an event, which describes a process step:

```json
{
  "source": {
    "id": "8237"
  },
  "type": "c8y_DobotProcessEvent",
  "time": "2022-05-03T09:29:11.704Z",
  "text": "Dobot Status: Idle",
  "status": "Idle"
}

```

The relevant field, which should be processed by the widget, is the `status` property. Inside the widget configuration you declare the mapping, e.g.:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/a/4/a4e3e50beb1f2343b419e75c2521f4e58e939bcd.png)

You need to define Event Type which is the type of your event. In the example above the value is `c8y_DobotProcessEvent`. In addition, you need to specify the property, which should be processed by the widget. In this case it’s the `status` property. Last, you have define the mapping for the values of the `status` property.

For the configuration above it will look like this:

 ![Image 15](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/6/3/63e386a9752958db3f555f5b1bb37d702b8be9a9.png)

Hope this helps

Best regards  
Christian

---

<div class="post-metadata">

**Author:** ![sumit.singh](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sumit.singh](https://community.cumulocity.com/u/sumit.singh)\
**Post date:** [May 4, 2022, 9:28am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/8 "2022-05-04T09:28:56Z")

</div>

Thanks for your support  
so i can ADD any data type in process widget right? like enum,string , BitString .

---

<div class="post-metadata">

**Author:** ![Christian\_Guether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_guether1/32/14848_2.png) [@Christian\_Guether1](https://community.cumulocity.com/u/Christian_Guether1)\
**Post date:** [May 4, 2022, 1:41pm UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/9 "2022-05-04T13:41:52Z")

</div>

Hi Sumit,

not sure what you mean by:

> i can ADD any data type in process widget right? like enum,string , BitString .

The process widget only processes Cumulocity events and evaluates a field, which needs to be configured in the settings of the process widget. The mapping for this field are defined in the `Field Value` column, which takes Strings as an input.

What do you mean by adding any data type in the process widget?

Best regards  
Christian

---

<div class="post-metadata">

**Author:** ![sumit.singh](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sumit.singh](https://community.cumulocity.com/u/sumit.singh)\
**Post date:** [May 5, 2022, 10:34am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/10 "2022-05-05T10:34:55Z")

</div>

thank u for your your respond adding any kind of data means suppose i have events and what ever i have in events i can use that in process widget but now its clear thanks for your support.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [August 3, 2022, 10:35am UTC](https://community.cumulocity.com/t/how-i-can-create-and-register-custom-templates-for-sending-messurmentes-in-cumulocity-iot/4098/11 "2022-08-03T10:35:05Z")

</div>

Closed on August 3, 2022, 10:35am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
