# Is it possible to store String in Cumulocity?

**URL:** <https://community.cumulocity.com/t/is-it-possible-to-store-string-in-cumulocity/7270>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [February 24, 2021, 4:05pm UTC](https://community.cumulocity.com/t/is-it-possible-to-store-string-in-cumulocity/7270 "2021-02-24T16:05:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![himanshutimes](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/himanshutimes/32/5695_2.png) [@himanshutimes](https://community.cumulocity.com/u/himanshutimes)\
**Post date:** [February 24, 2021, 4:05pm UTC](https://community.cumulocity.com/t/is-it-possible-to-store-string-in-cumulocity/7270/1 "2021-02-24T16:05:14Z")

</div>

Hi Folks,

My goal is to store some basic forms data related to device in cumulocity.

The data also contains String and Boolean form of data.

Is there is any way to store that data in Cumulocity.

If yes so, please tell the the complete steps.

Thanks,  
Himanshu Agarwal

---

<div class="post-metadata">

**Author:** ![mstoffel](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mstoffel](https://community.cumulocity.com/u/mstoffel)\
**Post date:** [February 25, 2021, 8:24am UTC](https://community.cumulocity.com/t/is-it-possible-to-store-string-in-cumulocity/7270/2 "2021-02-25T08:24:26Z")

</div>

Hi Himanshu,

since Cumulocity uses a document based database you can store arbitrary fragments in a device. Devices are basically ManagedObjects that are managed via the Inventory API:

[https://cumulocity.com/guides/reference/inventory/](https://cumulocity.com/guides/reference/inventory/)

You can also add properties using the Properties Library under Administration → Settings. Those can then be used e.g. in an Asset Properties Widget in the Cockpit Application.

Hope that helps.

Kind Regards,

Marco

---

<div class="post-metadata">

**Author:** ![himanshutimes](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/himanshutimes/32/5695_2.png) [@himanshutimes](https://community.cumulocity.com/u/himanshutimes)\
**Post date:** [February 26, 2021, 12:46pm UTC](https://community.cumulocity.com/t/is-it-possible-to-store-string-in-cumulocity/7270/3 "2021-02-26T12:46:47Z")

</div>

I have store in events and and in text i have store complete json object as string, is it a right approach ?

---

<div class="post-metadata">

**Author:** ![mstoffel](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mstoffel](https://community.cumulocity.com/u/mstoffel)\
**Post date:** [March 1, 2021, 8:32am UTC](https://community.cumulocity.com/t/is-it-possible-to-store-string-in-cumulocity/7270/4 "2021-03-01T08:32:22Z")

</div>

The basic structure of an [event](https://cumulocity.com/guides/reference/events/) has a few mandatory (source, type, time) fields. In addition there a some predefined fragments which are supported by the platform ootb. See the example below. There we have a location update which is interpreted by the platfrom using the c8y\_Postition fragment.

```auto
{
	"source": {
    	"id":"2284329" },
    "type": "c8y_LocationUpdate",
    "text": "Location Update",
    "time": "{{current_C8Y_time}}",
    "c8y_Position": {
        "alt": 67,
        "lng": 10,594389,
        "lat": 50,80473
    }
}

```

Your can easily add your own fragment to that or create a complete new Event Type.

```auto
{
	"source": {
    	"id":"2284329" },
    "type": "c8y_MyStringEvent",
    "text": "MyString",
    "time": "{{current_C8Y_time}}",
    "myString": "This is my string"
}

```

Hope that helps!

---

<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:** [February 13, 2024, 12:05am UTC](https://community.cumulocity.com/t/is-it-possible-to-store-string-in-cumulocity/7270/5 "2024-02-13T00:05:32Z")

</div>

Closed on February 13, 2024, 12:05am UTC

This topic was automatically closed after 1083 days. New replies are no longer allowed.
