Summary
By default, when the input is left blank, clicking Apply in the ArcGIS Experience Builder Query widget returns every feature from the table, which makes identifying relevant results difficult. To address this behavior, the query can be configured to return a single record with no attribute value, preventing all records from being displayed when no input is provided.
This article provides the workflow to limit the results returned by the Query widget in ArcGIS Experience Builder when the input is blank.
Procedure
Add a new feature with no attribute values and sort the field to place the feature as the first record in the table. The Query widget uses the first available feature in the table to display a blank result when the record is counted.
- In ArcGIS Online, open the web map and add a point feature with no attribute values within the existing feature layer.
- Save the map.
- Open the existing ArcGIS Experience Builder web experience. Refresh the web experience, if necessary.
- On the sidebar of the web experience, click the Data tab.
- In the Data panel, select the web map card and click the feature layer card.
- Create a new data view and sort the records.
- In the feature layer details pane, on the Data views tab, click + Create a view.
- In the Data view window, click Sort > + Add a sort field.
- Select the OBJECTID field from the drop-down menu to sort and click the Descending order so the newly created feature is treated as the first feature in the table.
- Click the Records tab, toggle Maximum on and specify Maximum record count as 1. The output record count is limited to one record, defaulting to the first available feature in the table.
- Click Apply changes.
- Click the Query widget on the canvas to open its configuration panel.
- In the configuration panel, on the Content tab, select the query item.
- In the Set query panel, under Data, select the newly created data view from the drop-down menu. In this example, Data view 1 is selected.
- Add a clause through the SQL Expression Builder and configure the clause by creating an expression.
- Under Attribute filter, click SQL Expression Builder > + Add clause.
- For the field input box, select the field from the drop-down list. In this example, the field EmployeeCount is selected.
- For the operator input box, select a functional operator from the drop-down list. In this example, the is operator is selected.
- Click Select source type and select User input.
- Click More input settings > Ask for values.
- Click OK.
- Navigate to Results and expand the section. For Configure each record, select Customize from the drop-down menu.
- Under Display fields, deselect the OBJECTID field from the drop-down list.
Note:
The OBJECTID field is automatically added to a table with default values. It is deselected from display to ensure the query result contains no attribute values.
- Click Save
and Publish to publish the experience.
The Query widget shows a single record with no attribute value returned as the query result when Apply is clicked with a blank input.