Select to view content in your preferred language

Arcade Data Expression

645
4
07-06-2023 05:00 AM
Kristofer
New Contributor III

Hi All,

I want to get the current time data using Data Expression.

sunita_0-1688644608501.png

 

In my feature layer having the data of (future as well as historic) current time and for the next two days on hourly basis i.e. 2:30 PM, 3:30 PM, I want to get the data which is related to current hour is running.

Let's suppose now time is 6:40AM. only push the feature which is coming under that time.

 

Regards,

Sunita

Tags (2)
0 Kudos
4 Replies
JakeSkinner
Esri Esteemed Contributor

Hi @Kristofer ,

See the following document, it shows how to create a dynamic date filter with arcade.

0 Kudos
Kristofer
New Contributor III

Hi @JakeSkinner 

I wanted to Data expression code but you have shared the documentation for pop-up.

Thanks for the response.

0 Kudos
Kristofer
New Contributor III

Hi @JakeSkinner 

I want to filter the data only for tomorrow from 12:00 am to 11:59 pm. I tried to using json editor also.

time BETWEEN timestamp(CURRENT_DATE (), +1, 'day') AND timestamp(CURRENT_DATE (), +1, 'day')

also wanted to another filter the data from tomorrow day after.

Could you please help me on this.

Regards,

Sunita

0 Kudos
JakeSkinner
Esri Esteemed Contributor

@Kristofer ,

Try the following:

var year = Year(Now());
var month = Month(Now());
var day = Day(Now()) + 1;
var hour1 = 00;
var minute1 = 00;
var second1 = 00;
var hour2 = 23;
var minute2 = 59;
var second2 = 59;
var dateField = $feature.duedate;

var tomorrowDate1 = Date(year, month, day, hour1, minute1, second1)
var tomorrowDate2 = Date(year, month, day, hour2, minute2, second2)

IIf(dateField > tomorrowDate1 && dateField < tomorrowDate2, 'future', 'past');

 

0 Kudos