I am new to Arcade and am using it to convert a dateTime to a text field inside QuickCapture. The text field should be "MM/DD/YYYY" (no number padding). To do so, I have tried both of the following equations:
"${arcadeExpression: Concatenate([text(Month($feature.Survey_Date_Time),M),text(Day($feature.Survey_Date_Time),D),text(Year($feature.Survey_Date_Time),Y)],'/')}"
"${arcadeExpression:var month = Text(Month($feature.Survey_Date_Time));var day = Text(Day($feature.Survey_Date_Time));var year = Text(Year($feature.Survey_Date_Time));var date = Concatenate([month,day,year],'/');return date;}"
Unfortunately, I keep getting "NaN/NaN/NaN". I tried to use the Text() function to change the result of the Month(), Day(), and Year() results from integer to text, but it does not appear to be the issue.
Any help you can provide is greatly appreciated.
Chris Anderson
Solved! Go to Solution.
The Text function is the easiest way to convert a Date to a text field.
return Text(Now(), "MM/DD/YYYY")
Thanks! That worked. I was thinking I had to go the Excel route to do the calculation.