# Obtain payload data

**URL:** <https://discourse.nodered.org/t/obtain-payload-data/86950>\
**Category:** General\
**Created:** [2 April 2024 23:04 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950 "2024-04-02T23:04:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoshiangel](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yoshiangel](https://discourse.nodered.org/u/yoshiangel)\
**Post date:** [2 April 2024 23:04 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/1 "2024-04-02T23:04:36Z")

</div>

I'm having trouble getting data from my payload, but specifically I want just a few pieces of data

```auto
["18,57,0,0.000000,0,6569,0.000000,19,55,0,0,0,0,0\n","18,57,0,0.000000,0,6570,0.000000,19,55,0,0,0,0,0\n","18,57,0,0.000000,0,6572,0.000000,19,55,0,0,0,0,0\n","18,57,0,0.000000,0,6573,0.000000,19,55,0,0,0,0,0\n","18,57,0,0.000000,0,6575,0.000000,19,55,0,0,0,0,0\n"]

```

I just want the value of 18 which is subject to change after a certain period of time or maybe the next, at some point this data will become more data and more, and I would like to know how to extract it.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [2 April 2024 23:12 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/2 "2024-04-02T23:12:28Z")

</div>

Your data is an array with 5 elements, each one of which is a comma separated string with "18" at the beginning.

So from this data do you just want the value 18, the string "18", an array ["18", "18", "18", "18", "18"], etc?

---

<div class="post-metadata">

**Author:** ![yoshiangel](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yoshiangel](https://discourse.nodered.org/u/yoshiangel)\
**Post date:** [3 April 2024 01:01 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/3 "2024-04-03T01:01:22Z")

</div>

the easiest way to integrate data into a chart

---

<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:** [3 April 2024 07:04 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/4 "2024-04-03T07:04:46Z")

</div>

Are those 5 values for different times? If not then how do you want the chart to appear?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 April 2024 08:10 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/5 "2024-04-03T08:10:20Z")

</div>

What generates that odd arrangement of data? Where does it come from and do you do any post processing to make it that format?

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [3 April 2024 12:24 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/6 "2024-04-03T12:24:34Z")

</div>

That looks like a CSV file split into lines -- if you knew what headers went with each column, you could just pass it to the `csv` node and get a payload object with fields for every value.

---

<div class="post-metadata">

**Author:** ![yoshiangel](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yoshiangel](https://discourse.nodered.org/u/yoshiangel)\
**Post date:** [3 April 2024 19:11 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/7 "2024-04-03T19:11:48Z")

</div>

That data comes out of my google sheet and is saved to my drive. The data is saved in a single column.

---

<div class="post-metadata">

**Author:** ![yoshiangel](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yoshiangel](https://discourse.nodered.org/u/yoshiangel)\
**Post date:** [3 April 2024 19:16 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/8 "2024-04-03T19:16:52Z")

</div>

Well yes it would be a csv since I am using googlesheet and all the data is saved in a single column and separated by commas.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95c103162f0a9580a39193f2b9b4b963706cb136.png)  
For sending and data acquisition I use this library:  
[google-sheets-advance](https://flows.nodered.org/node/node-red-contrib-google-sheets-advance)

---

<div class="post-metadata">

**Author:** ![yoshiangel](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yoshiangel](https://discourse.nodered.org/u/yoshiangel)\
**Post date:** [3 April 2024 19:21 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/9 "2024-04-03T19:21:49Z")

</div>

These values were obtained every two seconds and for the distribution of the chart I want the first value to be related to temperature 1, then the others would be a replica of other different sensors. What I plan is to plot data for about a week and the easiest way to save them in google sheet. I am using flow fuse which is the node-red but on the internet. I use this library to communicate with my Google sheet:  
[google-sheets-advance](https://flows.nodered.org/node/node-red-contrib-google-sheets-advance)

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [3 April 2024 22:21 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/10 "2024-04-03T22:21:42Z")

</div>

> [@yoshiangel](#):
>
> I am using googlesheet and all the data is saved in a single column and separated by commas

Seems like google sheets would be better used to hold each piece of data in its own cell -- not all in one column as a comma-delimited string... just sayin'

---

<div class="post-metadata">

**Author:** ![yoshiangel](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@yoshiangel](https://discourse.nodered.org/u/yoshiangel)\
**Post date:** [4 April 2024 01:15 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/11 "2024-04-04T01:15:51Z")

</div>

I think the same thing, but maybe it is the pre-sending of data in my case I am sending it directly from an html and maybe that is the problem in the first instance.  
In the image 1 are the data to send to the google sheet and so are sent, where I then process them with the CSV function to send all the data (image 2) because I did not let me send them all.

**Image1:**  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/d/8dc8b951131f0f11db42cf03c73438c1574462f2.png)

**Image2:**

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f972c51be8de01d9b61d0d5659e1d5d428a0c092.png)

---

<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:** [3 July 2024 01:16 UTC](https://discourse.nodered.org/t/obtain-payload-data/86950/12 "2024-07-03T01:16:50Z")

</div>

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