How do I setup an arcade expression that compares the Scheduled_Site_Visit field "8/11/2021, 1:00:00 PM" to todays date and if it equals todays date which is 8/11/2021 then tell the list for item 8/11/2021 to change the background color to red (hex code: #F3DED7) ?
var today_date = Today();
var color = IIF($datapoint.Schd_Site_Visit == today_date, '#F3DED7','');
return {
textColor: '',
backgroundColor: color,
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
// attributes: {
// attribute1: '',
// attribute2: ''
// }
}
Solved! Go to Solution.
probably use DateDiff as a comparator of the timestamps - as per Solved: Arcade expression for date equals today or earlier - Esri Community
probably use DateDiff as a comparator of the timestamps - as per Solved: Arcade expression for date equals today or earlier - Esri Community
Hi @DavidPike & @neomapper , I've got this very thing to work before as well using DateDiff. I've found this article very useful and I am not sure I saw it linked to David's post. Hope it helps, great question neo!
https://developers.arcgis.com/arcade/function-reference/date_functions/
Cheers,