Select to view content in your preferred language

Using Arcade to display current day's data

770
3
04-14-2020 06:22 AM
SarahLinn1
Emerging Contributor

I have a bunch of points that are created daily via Survey123 that data is then displayed in ArcGIS Online.  In AGO I would only like to display the current day's data using Arcade.  

This is what I am using and the code is correct but it only returns any day but today.

if ($feature.Date = today())

{return 'this'}

else {return 'that'}

Lil' bit of a novice so this may be obvious but what am I doing wrong?

Tags (1)
0 Kudos
3 Replies
VictorCoelho
Regular Contributor

Hi Sarah,

The Today()  function return the current date with time truncated, the time could be the issue of why your survey123 date is not matching with the Today() function.

e.g. Mon Oct 24 2016 00:00:00 GMT-0700 (PDT)
0 Kudos
SarahLinn1
Emerging Contributor

I think that you are right but how do I convert it to be the same as my date field?

0 Kudos
VictorCoelho
Regular Contributor

Check if your survey data is storing the time, you can compare both date by creating a new date making sure the time is not present.

e.g: Date(Year(Today()),Month(Today()),Day(Today()))

0 Kudos