I have a point layer used for request work permits and I created a Web Application. I symbolized points using Arcade expression according to the expire date. But now user wants to expired points to be deleted. Does someone has some idea how to do it and help me? Thank you!
Currently my Arcade looks as in attachment.
Solved! Go to Solution.
I really like Johannes ' idea to leave Expired points unsymbolized.
Otherwise I would suggest a scheduled Python script that would examine the age of all the points and remove or archive the expired points. To maintain a history I think it would be best to archive the expired points or leave them unsymbolized. To archive the points your Python script should copy the points to a new feature class before deleting them.
Bernie.
Your expression can be simplified:
var time1 = Date($feature.enddate)
var dd = DateDiff(time1, Now(), "days")
return When(
dd <= 0, "Inactive",
dd <= 5, "5 days or less to expire",
"Active"
)
You have a few possibilities:
// Calculation Attribute Rule on your poit fc
// triggers: Insert
// field: empty
// exclude from application evaluation
var deletes = []
for(var f in $featureset) {
var dd = DateDiff(f.DateField1, Now(), "days") // replace with the name of your date field
if(dd <= 0) {
Push(deletes, {globalID: f.GlobalID})
}
}
return {
edit: [{
className: "TestPoints", // replace with the name of your point fc
deletes: deletes
}]
}
Hi Johannes, many thanks for your suggestions. I used the strategy to not showing expired permits but user is not pleased. So I'll try the python option which looks a good option.
I really like Johannes ' idea to leave Expired points unsymbolized.
Otherwise I would suggest a scheduled Python script that would examine the age of all the points and remove or archive the expired points. To maintain a history I think it would be best to archive the expired points or leave them unsymbolized. To archive the points your Python script should copy the points to a new feature class before deleting them.
Bernie.