# \[feature request\] Option to make a data dumb of all your logic values

**URL:** <https://community.homey.app/t/feature-request-option-to-make-a-data-dumb-of-all-your-logic-values/69861>\
**Category:** Ideas & Suggestions\
**Tags:** featurerequest\
**Created:** [October 4, 2022, 11:48am UTC](https://community.homey.app/t/feature-request-option-to-make-a-data-dumb-of-all-your-logic-values/69861 "2022-10-04T11:48:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![B3rt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/b3rt/32/9435_2.png) [@B3rt](https://community.homey.app/u/B3rt)\
**Post date:** [October 4, 2022, 11:48am UTC](https://community.homey.app/t/feature-request-option-to-make-a-data-dumb-of-all-your-logic-values/69861/1 "2022-10-04T11:48:27Z")

</div>

Maybe someone is looking for an idea for creating a app or tool.

Don’t know if it is possible but it would be nice to have an option to create a (json) data dump of all your logic\_values.

I often create a flow card to write a log file (using papertrails or simple log) and eachtime I have to select the data i wish to log into the flow card.  
It would be great if there was an option to trigger to create a snapshot/data dumb of all logic values currently in Homey and output them into a json string which then can be save (or send/used). When doing this jou just have all logic values and when looking for an error/bug in your flows you can lookup the data of the time the dumb was created.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 4, 2022, 5:50pm UTC](https://community.homey.app/t/feature-request-option-to-make-a-data-dumb-of-all-your-logic-values/69861/2 "2022-10-04T17:50:37Z")

</div>

I think you mean data dump ?  
Here’s a start:

```auto
const logicVars = await Homey.logic.getVariables()
for (var iLogicVar in logicVars){
  if (logicVars[iLogicVar].name != "")

    console.log(`"${logicVars[iLogicVar].type}-variable","${logicVars[iLogicVar].name}","value","${logicVars[iLogicVar].value}",`);

}

return(true);

```

 ![Screenshot from 2022-10-04 20-05-46](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/a/2afbb745fa642a4c43452b8b6826920e23203d36.png)

---

<div class="post-metadata">

**Author:** ![B3rt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/b3rt/32/9435_2.png) [@B3rt](https://community.homey.app/u/B3rt)\
**Post date:** [October 4, 2022, 7:57pm UTC](https://community.homey.app/t/feature-request-option-to-make-a-data-dumb-of-all-your-logic-values/69861/3 "2022-10-04T19:57:59Z")

</div>

Thx but i cannot get it to work as i want it.  
I cannot get the output into a text card which i can then save using simple log.

The code @Arie_J_Godschalk wrote works fine  
return JSON.stringify(await Homey.logic.getVariables());  
but it is not filtered as in your demo.

So youre code does what i want, but now only i need it as a string as in Arie example

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [October 4, 2022, 8:21pm UTC](https://community.homey.app/t/feature-request-option-to-make-a-data-dumb-of-all-your-logic-values/69861/4 "2022-10-04T20:21:32Z")

</div>

Use this in the HS Run Code - Return TextTag

```auto
let str='';
const logicVars = await Homey.logic.getVariables()
for (var iLogicVar in logicVars){
  if (logicVars[iLogicVar].name != "")

    str+= `"${logicVars[iLogicVar].type}-variable","${logicVars[iLogicVar].name}","value","${logicVars[iLogicVar].value}",`;

}

return str;

```

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/f/2f7b07375a478e4caf4d7b6a56a67c48f3ff23d5.png)

```auto
[TEF:FLOWS:H4sIAAAAAAACA32S32+CMBDH/5XuskTNqEGKFDG8bFmyhz3NZC9iYsXimmAhpTgN4X9fW3/sxe2B0nzvc3ffu7QDDUkHebUfM/1lTvPxU5MrUbuAhATerLQ4S33vAYNk2YEwETLzGad+gOMJzXEYRTHeTIoIEzolzOcBoSwGzxV5PbJ9XXL0TJQ2EodEq5Z7kNsuJJjN4gmJMKXhFIeEhnhDgxlmvAiDggY+mXDLHSGJfA9OkMTmV5myzm7C6jq5P4LnfKpWvlRb/sF1q2Sz0ErInQmZCYHlWlQS3FR2D1vTCEquUaNVOhjMM5XJvJKNRmW1E/knUw1KEftmQiO3mLHTxzuuTUywTcmb4chmFZVCwwNTSLxfMpGQv1VGnYUQEgUa3sTljV2NJdtz9JCiDDJwBc88ss6eUrTO4LG7m6hPNe/x4eImA+9P0rboHXBgZfsv6gDLrudXL/31otxera+5eSB9v+p/AHY38yVXAgAA]

```

---

<div class="post-metadata">

**Author:** ![B3rt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/b3rt/32/9435_2.png) [@B3rt](https://community.homey.app/u/B3rt)\
**Post date:** [October 4, 2022, 9:05pm UTC](https://community.homey.app/t/feature-request-option-to-make-a-data-dumb-of-all-your-logic-values/69861/5 "2022-10-04T21:05:29Z")

</div>

Thx, this works!
