Many thanks. Two things solved. Now I’m calculating the {{ timeMin }} by a payload provided by a prior function. would be nice a UTC time data node in the future. Regarding the items parse, is really simple to deploy from a javascript function like this:
if(payload.Events) {
var t = new Date();
payload.Events.body.Time = t;
payload.Events.body.Total = payload.Events.body.items.length;
var evento_start = new Date();
var evento_end = new Date();
var nombre = “”;
var autor = “”;
for(var i = 0; i < payload.Events.body.items.length; i++){
evento_start = new Date(payload.Events.body.items[i].start.dateTime);
evento_end = new Date(payload.Events.body.items[i].end.dateTime);
if(t > evento_start & t < evento_end){
payload.Events.body.Count = i;
nombre = payload.Events.body.items[i].summary;
autor = payload.Events.body.items[i].creator.email;
payload.Events.body.EventoStart = evento_start;
payload.Events.body.EventoEnd = evento_end;
payload.Events.body.Dentro = “Dentro”;
return { Time: t, Count: i, Estado: "Dentro", Nombre: nombre, Autor: autor, Start: evento_start, End: evento_end};
}
else
if(t < evento_start){
payload.Events.body.Count = i;
nombre = payload.Events.body.items[i].summary;
autor = payload.Events.body.items[i].creator.email;
payload.Events.body.EventoStart = evento_start;
payload.Events.body.EventoEnd = evento_end;
payload.Events.body.Dentro = “Proximo”;
return { Time: t, Count: i, Estado: "Proximo", Nombre: nombre, Autor: autor, Start: evento_start, End: evento_end}; }else payload.Events.body.Dentro = "Todos Fuera";
}
}
return { Time: t, Count: payload.Events.body.items.length };
Now this function is providing me a payload with useful information about the status events into the calendar, I mean if we are into an event or not and information about the incoming event.
Now the next steps are about OAuth authentication, which is very useful on many services that require authentications prior to connect. I have some questions on this but I’ll open a different topic.
https://forums.losant.com/t/oauth-authentication-workflow/181?u=andres_garcia