I have a calculated expression for a field in the form that I have set up to auto populate a "yes" or "no" response depending on the date cleaned. The arcade I have written compares the "date cleaned" (a manually filled in field) with the current date. It is set to return "Yes" if it is less than or equal to a 5 day difference and "No" if it is greater than a 5 day difference. This is working in Arcade and when I make edits in web map in AGOL but when I try making updates to the data in Field maps app on my phone it says "Failed to calculate". I don't understand why it is working in the App but not AGOL.
Here is the Arcade script:
var CleanedDate = DateOnly($feature.CleanedDate)
Var Cleaned_Status = DateDiff(DateOnly(Today()), CleanedDate, 'days')
if (Cleaned_Status <=5)
Return "Yes"
if (Cleaned_Status > 5)
Return "No"