Node red convert string to fields

#1

Hello i want a way to convert my string data into Json fields where they can be read by things speak

0 Likes

#2

maybe the json node :wink:

0 Likes

#3

when i do that i get this error

0 Likes

#4

before the split ?

0 Likes

#5

same things

0 Likes

#6

so what is going into the split ? What is the split actually splitting up ? is that a string ? can you just paste that string ?

0 Likes

#7

before splitting is this ,the decrypt payload is just to decrypt the binary array

0 Likes

#8

But no matter - a function after the split like this - should do it (instead of the json node)

var m = msg.payload.split(':');
msg.payload = {};
msg.payload[m[0]] = m[1];
return msg;
0 Likes

#9

thank you i appreciate it now i have like that but i cant get any entries in the thingspeak using thingspeak42

0 Likes

#10

No idea - never used that node - - looks like it is actually asking for topics with values not an object ... so I'd guess maybe this instead...

var m = msg.payload.split(':');
msg.topic = m[0];
msg.payload = m[1];
return msg;

but I've never used it - so you'll have to read their docs.

0 Likes

#11

thank you very much

0 Likes

#12

now at least has data queuing but am getting this error

0 Likes

#13

Lookup http error 400. I think it means not allowed (is bad credentials)

0 Likes

#14

400 (Bad request) The server didn't understand the syntax of the request.

1 Like

#15

i put all credential right i looked it up there is no solution

0 Likes