Project user input variable

A project user input variable value is populated by the app user, and you can apply it to one or more buttons in a project. The app user enters the value; however, the project author must define the buttons and fields to which the variable will apply.

The following apply to a project user input variable:

  • Up to three project user input variables can be defined per project.
  • Its value is entered by the user before pressing a button. If the user input is set as required, the user is prompted to enter this value when starting the project but can edit the value at any time.
  • You can apply its value to any text fields in any buttons.
  • You can apply its value to a text or integer field that is configured with a coded value domain.
  • You cannot apply its value to a text field that is configured with a range domain.

Properties of the project user input variable are as follows:

  • Label—Text that appears as the title of the project user input page in the app.
  • Input type—Can be single-line or multiline text or a choice list. For choice lists, you define the values and can allow free text entry. Use a dynamic choice list to populate values from fields in a query layer or table that you add to the project.
  • Apply hint—Display hint text on the project user input page in the app.
  • Apply an input mask—Define the format for data entry by using characters and symbols to define an input mask.
  • Show barcode scanner—Use the barcode scanner on the input dialog box for text field entry.
    Note:

    The following formats are supported: QR CODE, UPC A, UPC E, EAN 8, EAN 13, CODE 39, and CODE 128.

  • Required—Specifies whether the mobile app user must provide the user input value before they can tap any button. When not required, the user can optionally enter a user input value by selecting the edit button (next to the user input value displayed at the top of the screen) and typing a value.
    Note:

    When applying a user input value to a feature layer with required fields, ensure that its required property is set to true to avoid submission errors.

A project user input variable is created and configured by the project author either on the Data tab for each field or in the Project user input menu item.

To assign a project user input variable to a capture field of a button, on the Data tab, from the drop-down menu of the capture field, choose Project user input.

Choose a project user input for a text field.

In the mobile app, the user is prevented from entering text that exceeds the length of the data field.

Create and use a dynamic choice list

A project user input can be populated with a dynamic choice list by associating it with an existing feature layer or table. The feature layer or table can be either editable or read-only. The content of the list can be controlled by the author by configuring properties of the list.

To create and use a dynamic choice list in a project user input, complete the following steps:

  1. Click a project button to display the Button panel, and select the Data tab.
  2. Choose Project user inputs for the Capture field that will store the selected value from the dynamic choice list.
  3. In the Capture field drop-down menu, select Create New.
  4. Enter a label for the dynamic choice list. This label will be displayed above the list.
  5. Choose Dynamic choice list for the Input type.
  6. Click Add, and click Browse all layers.
  7. Select a feature layer or table that will be queried in order to populate the list.
    Note:

    Unused query layers are removed from a project when saving. If you add multiple query layers here or using the Manage project layers panel, be sure to add the query layer to at least one button before saving the project.

  8. Complete the remaining properties as follows:
    Tip:

    While completing these properties, you can review sample results in the Choice list preview side panel.

    • Display field—The value that is displayed in the mobile app.
    • Value field—The value that is stored in the layer.
    • Sort field—The field used to sort the dynamic choice list.
    • Sort order—Ascending or descending.
    • Update mode—Manual or automatic. When manual, if the user input is set as required, the list is updated when the project is opened the first time only. Subsequent updates will only occur when the user drags down the list. When automatic, if the user input is set as required, the list is updated when the project is opened or when the user input is edited.
    • Filter—The criteria used to limit the values displayed in the dynamic choice list. Click the Add filter button to create a filter.
  9. Click Create.

This newly created project user input will be set for the Capture field selected.

The mobile app will only return the first page of results for a list, which by default for an ArcGIS Online feature service is 2,000 records.

A dynamic choice list is available for offline use after it has been viewed once in the mobile app. To get updates to the list, the device must be online when the list is reloaded.

Create a filter

A filter is used to limit the features or values that are displayed in a project user input dynamic choice list. You can specify one or more conditions to limit what is displayed in the list.

To create a filter, complete the following steps:

  1. In the Filter pane, click the field selector and select a field to use for the expression.
  2. Click the operator selector and select an operator, such as between, equals, or includes.

    If you select a date field, different operators are shown. You can use the is within the last operator to apply a dynamic relative-date filter to show events that occurred relative to the current day—for example, all records created in the last five days—without manually updating the filter every day.

  3. In the value input box, enter a value to use in the expression. The resulting list is previewed to the side of the query builder.

    The input box varies depending on the field type and the operator. For example, if you selected the includes or excludes operator, you select from a list of data values in the specified field.

    If you specified a date field, depending on the operator selected, you can specify a period, a single date from the calendar, or enter a single date.

  4. Optionally, add another expression to the filter by choosing And (to specify that all filter criteria must be true) or Or (to specify that any filter criteria can be true).
  5. Click Create to save and use your filter. If you are editing an existing choice list, click Done.

You can also use the Advanced formatting option to create or edit a filter. In this view, you construct or modify the conditions for the WHERE clause directly in the expression. You can use the options to select a device variable (username, fullName, firstName, lastName, or email) or a field from the selected layer. For example, assuming that the canvasser field in the selected layer contains usernames, to filter the list to values that only match the username of the canvasser currently signed in to the app, enter the expression Canvasser='${username}'

Note:

When you click Advanced formatting, the filter is shown as an expression. You can edit the expression, but you cannot switch back to the filter builder. To see the filter builder, close the user input dialog box and open it again. The filter will have been saved, and you can edit the filter using the field, operator, and value selectors.