Dashboard- Arcade Last edit date

08-03-2021 12:40 PM
MVP Regular Contributor

I am trying to figure out how to get the last edited feature to be the one filtered out. 

This works for part of the day. There are just a few hours where it does not work. From 10am (local time) until I enter that days data.  I usually enter new data midday.  It does not pull in the last edited based on time. It pulls in based on date and when there are two from the same day it will pull the wrong feature. 

I get No Value because it is pulling the wrong edit date. 



My expression:


var portal = Portal("https:///portal/");
var fs = FeatureSetByPortalItem(

// Find the most recent date from the date field to filter the FeatureSet for the latest record
var maxDate = Text(Date(ToLocal(Max(fs, 'last_edited_date'))),"YYYY-MM-DD");
return Filter(fs, "Date_ = @maxDate");



0 Kudos
4 Replies
MVP Frequent Contributor

Can you just find the greatest difference in milliseconds between your UTC last-edited date and another arbitrary date?

var date1 = Date(2020, 1, 1, 1, 1, 1)
var date2 = Now()

return DateDiff(date2, date1)

Also you have 'Inputted' and 'Inputed', I'm not sure ieitheris the correct word as isn't that past tense? Possibly 'input' or 'entered'? Just my 5 cents. 

MVP Regular Contributor


I have fixed the typo thanks. My hope is that if I get this figured out I will not have to worry about which is correct because some data should always be displayed. 
I do like the idea of getting the greatest difference. I just need to figure out how to apply it now. 

0 Kudos
MVP Regular Contributor


I found a blog that has helped. I can sort by last edit date. I can also tell it to display only 1 record. 



0 Kudos
MVP Frequent Contributor

That seems much simpler.

0 Kudos