Hi there,
I am very new to coding and using this within my ArcGIS Online maps. I'll first try to explain what I would like to achieve with the expression and than I'll come to what I already have and what I need help with.
So what we have is location of trees with some information within this database. Within this database is also a frequency mentioned for how many times these trees need to be inspected. For example yearly or once every 3 years. For the inpections we use Survey123 form and with a custom URL we copy this frequency (and some more values) within the database of the inspections. This frequency is shown as a number depending on how many years there should be between inspections. So this can be a '1' or a '3' or acualty any number of years.
I would like to use this frequency for my symbology, to change the symbol when the year has passed from 'Inspected' to 'Need to be inspected'
I found this piece of code here and tried to apply this for my case and change the "days" to "years" but it keeps on saying 'Inspected'.. What am I doing wrong?
found:
var days = DateDiff(Now(), $feature.LastSurveyDate, "days");
if (days > 30) {
return "This has not been surveyed in past 30 days";
} else {
return "This has been surveyed in past 30 days";
}
changed to:
var days = DateDiff(Now(), $feature.test, "year");
if (year > $feature.Frequentie) {
return "Inspecteren";
} else {
return "Geïnspecteerd";
}$feature.Frequentie stands for the amount of years and $feature.test is a date field with testing date for testing the symbology. Normally the $feature.EditDate will be used here.
What I am doing wrong? And what do I have to change to make it work?