Summary
In ArcGIS Experience Builder, the Text widget can be used to create dynamic text to populate specific record counts of an attribute. For example, a feature layer containing multiple fields has one specific attribute which only has ‘Yes’ or ‘No’ records, and dynamic text is created to display only the ‘Yes’ record counts. Dynamic text is also useful to reflect the latest record counts when the attribute records are updated.
This article provides the workflows to display the record count of an attribute using dynamic text in ArcGIS Experience Builder.
Procedure
- In ArcGIS Experience Builder, click Data .
- On the Data panel, browse to and click the data card to open its details pane.
- In the details pane, on the Layers tab, click the feature layer card to open its details pane.
- In the feature layer details pane, on the Data views tab, click Create a view.
- In the Data view window, under Filter, click Add and click Clause. Configure the clause by creating an expression as follows.
- Click the field drop-down list and select the field displaying the attribute record to be counted. For this example, ‘Vaccinated’ is selected.
- Click the clause drop-down list and select the desired clause. For this example, ‘contains’ is selected.
- Specify the attribute record to be counted. For this example, ‘Yes’ is specified.
- Click the Select source type icon to complete the expression.
- Click Apply changes.
Note:
Perform only Step 5 when the attribute data is updated.
- On the Insert widget panel, search for the Text widget, drag and drop it to the canvas.
- Click the Text widget. On the right panel, on the Content tab, configure the following settings.
- Turn on the Connect to data toggle.
- Under Connect to data, click Select data.
- Under Select data, click the Expand icon to expand the feature layer options of the Map widget, and select the desired feature layer.
- Under Connect to data, click the selected feature layer’s drop-down list options, and check the Data view 1 check box.
- In the Text widget on the canvas, specify the heading for the record attribute count to be displayed. For this example, ‘Number of postgraduate students successfully vaccinated’ is specified.
- In the Text widget on the canvas, click the Dynamic content button .
- In the Dynamic content window, click Expression and configure the following settings.
- Under Expression, in the first text box, specify the name of the dynamic text. For this example, ‘Successfully Vaccinated Students’ is specified.
- Under Expression, click the Functions option and click COUNT to populate the function in the second text box to form an expression.
- Under Expression, click the Fields option and click the desired field under Data to complete the expression in the second text box. For this example, ‘Name of Students’ is selected.
- Click Insert on the bottom of the window to populate the expression in the Text widget.
- Click Save to save the configurations.
The image below displays the dynamic text that populates the attribute’s record counts in the ArcGIS Experience Builder experience.