HOW TO
Surveys are series of questionnaires designed to collect various types of data for research or analysis purposes. In ArcGIS Survey123, both qualitative and quantitative data can be collected.
In some cases, some qualitative data, such as the names of weekdays or months, must be recorded in a quantitative manner for data tabulation. This article describes the workflow to convert weekday and month strings to integers in ArcGIS Survey123 Connect. The JavaScript getDay() function is used to convert weekday strings (Monday, Tuesday, Wednesday) to integers (1-7), and the getMonth() function to convert month strings (January, February, March) to integers (1-12).
function myfunction(<date_name_field>) { var dt = new Date(<date_name_field>); return dt.getDay() + 1 }
function myfunction(<date_name_field>) { var dt = new Date(<date_name_field>); return dt.getMonth() + 1 }
The image below shows both functions are pasted into the calculation column of the respective note questions.
The image below demonstrates the date conversion. Sunday, the first day of the week, is converted to 1, while July, the seventh month of the year, is converted to 7.
Article ID: 000030838
Get help from ArcGIS experts
Download the Esri Support App