# How to add edit/add metadata to a stored variable in a bucket?

**URL:** https://community.tago.io/t/how-to-add-edit-add-metadata-to-a-stored-variable-in-a-bucket/1173
**Category:** Devices and Connectors
**Created:** [June 6, 2022, 5:05pm UTC](https://community.tago.io/t/how-to-add-edit-add-metadata-to-a-stored-variable-in-a-bucket/1173 "2022-06-06T17:05:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jjuno](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jjuno](https://community.tago.io/u/jjuno)
#### Post date: [June 6, 2022, 5:05pm UTC](https://community.tago.io/t/how-to-add-edit-add-metadata-to-a-stored-variable-in-a-bucket/1173/1 "2022-06-06T17:05:43Z")

</div>

Dear all,

I currently have an agricultural application, with sensors that collect soil information like humidity, temperature, etc. My devices send this data in hexadecimal and through a payload parser I get my variables. By doing this I generate my data with the structure { variable, value, unit, location(optional) }.

As I want to make the presentation of my dashboards more intuitive, I would like to be able to add the color, icon, x, y, url, etc. metadata. In order for me to decide what metadata value to add to my variable, I need to do an analysis, because I need to compare the values obtained with the thresholds that my user sets from an input widget. Finally I generate a new data, which is exactly the same as my original data, but has added the metadata I require for my dashboards. This solution that I have has the problem that it generates duplicate data, that is to say I have the original variable (that comes from the payload parser without metadata) and the new generated variable with metadata (this one has the same value and unit that the original one). Logically this solution greatly increases my storage usage.

What I want to do with my analysis is to be able to add the metadata to my existing variables, but so far I haven’t figured out how to do it. Could you provide me with some example code to do this, I would be very grateful for your answers.

---

<div class="post-metadata">

### Author: ![vitorfdl](https://yyz2.discourse-cdn.com/flex034/user_avatar/community.tago.io/vitorfdl/32/1728_2.png) [@vitorfdl](https://community.tago.io/u/vitorfdl)
#### Post date: [June 8, 2022, 6:10pm UTC](https://community.tago.io/t/how-to-add-edit-add-metadata-to-a-stored-variable-in-a-bucket/1173/2 "2022-06-08T18:10:52Z")

</div>

Hi Loratech,

If you’re using an Immutable dashboard, which I presume you’re. It is not possible to edit existing variables that are stored.

Which means you’re already using the best approach from what you’ve described.

One way I could think to optimize your setup is to have the thresholds you need stored in your Device’s configuration parameter. This way you will be able to resolve the metadata using the Payload Parser, as the parser is able to access your configuration parameters.

In order to set configuration parameter to a device, you can use the following code:

```auto
const account = new Account({ token: "your account-token"});
account.devices.paramSet(deviceID, { key: "your key", value: "your value" });

```

We also provide some snippets that handles configuration parameter. I recommend you to check the “Configuration Parameter for dynamic last value”
