List or Table Widget Calculate Age

388
1
Jump to solution
05-05-2023 03:20 PM
Labels (1)
bkaplan1
New Contributor II

I'm trying to create a dashboard in Experience Builder with a table or list.  The data includes the date of the installation of street scape item.  I'm trying to create a list with the age of the item along the lines of today()-InstallDate.   I can do this in the ArcGIS Dashboards with Arcade but Dashboards on a phone are not responsive to the screen size.   I would like to use Experience builder but cannot find a way to do the calculation on the fly.   Is it possible in Experience Builder.  Is it possible another way?

0 Kudos
1 Solution

Accepted Solutions
bkaplan1
New Contributor II

It would be a very welcome feature to expand the functions currently in the expressions from Average, Count, Sum, Min and Max to include arcade expressions.   The work around I came up with was to create an additional field of age in days in the feature layer and create a notebook script that is run daily to update the field with the age.    It is important to know that when you use the python api to pull the date from the feature layer, the day is an unix timestamp integer and it had to be converted.  This could be better documented in the help pages.  UTC_datetime = datetime.utcfromtimestamp(field).  And somehow the software flagged the date in the table as local time so this function converted from local to UTC so you may want to consider a time zone conversion or be sure the time in the table is UTC.  Best to you all.

View solution in original post

0 Kudos
1 Reply
bkaplan1
New Contributor II

It would be a very welcome feature to expand the functions currently in the expressions from Average, Count, Sum, Min and Max to include arcade expressions.   The work around I came up with was to create an additional field of age in days in the feature layer and create a notebook script that is run daily to update the field with the age.    It is important to know that when you use the python api to pull the date from the feature layer, the day is an unix timestamp integer and it had to be converted.  This could be better documented in the help pages.  UTC_datetime = datetime.utcfromtimestamp(field).  And somehow the software flagged the date in the table as local time so this function converted from local to UTC so you may want to consider a time zone conversion or be sure the time in the table is UTC.  Best to you all.

0 Kudos