Bellavista
(Bellavista)
1
Hi all, can you help me.
i have a inject node
whith
msg.time -> timestamp
msg.payload -> {"commands":[{"code":"meal_plan","value":"CQADAQwAAwEPAAMBEgADARUAAgEAAAMA"}]}
in flow -> gatti_meal_plan_to_app
i want to create a function whit same inject resul getting the var gatti_meal_plan_to_app from flow
thank you
Bellavista
(Bellavista)
2
I create this
var gatti_meal_plan_to_app = flow.get("gatti_meal_plan_to_app");
var text_a = '{"commands":[{"code":"meal_plan","value":"'
var text_b = '"}]}'
msg.time = Date.now();
msg.payload = text_a + gatti_meal_plan_to_app + text_b;
return msg;
it work don’t work like injection…for timestamp?
Bellavista
(Bellavista)
3
from inject node i recive
from function i recive
strange payload and time are swiched
there is a control of these?
WallyR
(Wally)
4
In a dict (dictionary) you have key/value pairs and the sorting of these are irrelevant. a dict is accessed by using the key.