Hello,
I have created an intervention management application on a sanitation network with the webappbuilder. I would like to generate alerts regarding the dates of completion of the work with Arcade for ArcGIS.
Someone knows how to create an Arcade script to generate alerts with different colors from the start date of the work and the maximum completion date.
Thanking you in advance!
Solved! Go to Solution.
Thank you
Hi Bazile Gagre ,
If your due date is an attribute of your features, you can base your symbology on the difference between the due date and the current date. You should probably include the completion date or status too in order to handle those assignments that have been completed.
Your expression could look something like this:
// make sure you point to the correct fields
var dueDate = $feature.dueDate;
var completedDate = $feature.completedDate;
var result = "";
if (!IsEmpty(completedDate)) {
// task is not completed yet
result = "completed";
} else {
// task is not completed yet, determine days to due date
var daysDif = DateDiff(dueDate, Today(), "days");
Console(daysDif);
// classify time to due date
if (daysDif >= 3) {
result = "more than 3 days to due date";
} else if (daysDif > 1) {
result = "only " + daysDif + " day(s) to due date"
} else if (daysDif == 1) {
result = "only 1 day to due date"
} else if (daysDif == 0) {
result = "due date is today!"
} else {
result = "Due date has passed!"
}
}
return result;
Thank you
You're welcome gagbaz . However, you marked you own answer with "Thank you" as the correct answer. The idea is that other users can find the correct answer easier, so maybe you can correct that?