Hello,
I am writing a very simple Arcade expression, but I am stuck. Basically, if the camp close date is empty and the post date is greater than 2 days, I want the background color to turn red. I am doing this in the dashboard list.
I get the error unexpected token on the return. If I delete it, I get it on the textColor.
__________________________________________________________________
var currentdate = now()
var postdate = Date($datapoint.firstpostda1);
var twodayslater = DateAdd(postdate, 2, 'days');
var pastduecolor = IFF((IsEmpty($datapoint.campclosedate)&&(currentdate > twodayslater), "#BE2528", "");
return {
textColor: '',
backgroundColor: pastduecolor,
separatorColor: '',
selectionColor: '',
selectionTextColor: '',
attributes: {
attribute1: pastduecolor
}
Thank you for your help.
Annette
You appear to have an extra "(" in your IIF
var pastduecolor = IFF(IsEmpty($datapoint.campclosedate)&&(currentdate > twodayslater), "#BE2528", "");
statement
Thank you. I deleted the "(" but I still get same errors.
Oops, one other error. The function is "IIF" not "IFF"