HOW TO

Limit the number of decimal places in ArcGIS Survey123 Connect

Last Published: May 29, 2025

Summary

In ArcGIS Survey123 Connect, survey responses can be constrained to a specific number of decimal places. This constraint ensures consistent data entry and compatibility with analysis and reporting formats.

This article describes the workflow to limit the number of decimal places in survey responses in ArcGIS Survey123 Connect. To demonstrate the workflow, the survey inputs for height measurements in meters are limited to two decimal places, such as 1.75.

Procedure

  1. In ArcGIS Survey123 Connect, open the survey's XLSForm.
  2. In the survey worksheet, in the type column, select text or decimal from the drop-down list.
  3. Specify the values in the name and label columns. In this example, the first question is named 'height' and labeled 'Height'.
  4. For the text question type, in the constraint column, specify the following expression. Replace <decimal_places> with the number of decimal places.
regex(., '^[0-9]+\.\d{<decimal_places>}$')'

The following is an example of the expression to limit the input values to two decimal places.

regex(., '^[0-9]+\.\d{2}$')

The decimal question type does not accept trailing zeros, such as 1.20, as valid input. As a workaround, use the following expression to allow numbers with trailing zeros after the decimal point. Replace <minimum_digit> and <maximum_digit> with the minimum and maximum number of digits allowed after the decimal point.

regex(.,'^\d+(\.\d{<minimum_digit>,<maximum_digit>})?$')

The following is an example of the expression to allow a minimum of one and a maximum of two digits after the decimal point.

regex(.,'^\d+(\.\d{1,2})?$')
  1. Save the XLSForm and publish the survey.

The survey below shows the "Invalid" error message returned when the response is not within the specified decimal format.

The Invalid error message when a wrong input is entered

Article ID: 000033866

Software:
  • ArcGIS Survey123 Connect

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options