# How can I get all the variables that I send by com from a pic

**URL:** <https://discourse.nodered.org/t/how-can-i-get-all-the-variables-that-i-send-by-com-from-a-pic/58223>\
**Category:** General\
**Created:** [12 February 2022 14:24 UTC](https://discourse.nodered.org/t/how-can-i-get-all-the-variables-that-i-send-by-com-from-a-pic/58223 "2022-02-12T14:24:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rona321](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Rona321](https://discourse.nodered.org/u/Rona321)\
**Post date:** [12 February 2022 14:24 UTC](https://discourse.nodered.org/t/how-can-i-get-all-the-variables-that-i-send-by-com-from-a-pic/58223/1 "2022-02-12T14:24:15Z")

</div>

from my pic i send to node red four data to node red, but I don't know how to separate each one to visualize it in the dashboard

I send this data just to test  
A=1  
H=2  
T=3  
N=4  
My Code in the pic is :  
printf("%i", A) ;  
printf("%i", H) ;  
printf("%i", T) ;  
printf("%i", N) ;

Help please i need to visualize them in the dashboard each one separately

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2022 14:57 UTC](https://discourse.nodered.org/t/how-can-i-get-all-the-variables-that-i-send-by-com-from-a-pic/58223/2 "2022-02-12T14:57:11Z")

</div>

If you send them as a json string then it wll make it easy. Change the code so that it sends something like this text  
`{"a": 1, "h": 2, "t": 3, "n": 4}`

Then in node red send it through a JSON node and it will convert it to a javascript object. Something like this might do it, but it is a long time since I used C(?)  
`printf('{"a": %i, "h": %i, "t": %i, "n": %i}', A, H, T, N);`

**[Edit]** That might need to be  
`printf("{\"a\": %i, \"h\": %i, \"t\": %i, \"n\": %i}", A, H, T, N);`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 April 2022 14:57 UTC](https://discourse.nodered.org/t/how-can-i-get-all-the-variables-that-i-send-by-com-from-a-pic/58223/3 "2022-04-13T14:57:53Z")

</div>

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