AnsweredAssumed Answered

Arcade - Declare variable at given time

Question asked by ametzler_mprb on Jun 28, 2019
Latest reply on Jul 3, 2019 by xander_bakker

Using Arcade, I am trying to declare a variable at 6pm every day. I want to record the temperature (from field $feature.TEMP) at 6pm each day and have that stored as a variable until the next day at 6pm. Here is what I have tried:

 

var TimeNow = Hour(Now()) + (Minute(Now())/100)
var Temp = 100

if (TimeNow == 18.00){
var Temp = $feature.TEMP;
}
else {
var Temp = Temp;
}
return Temp

 

However, using IF or WHEN only populates the temperature for that minute when the statements are true. Is there a function I could write to declare the variable at 6pm?

Outcomes