Dynamic Text to show the count of specific attribute

314
0
04-25-2025 12:11 PM

Dynamic Text to show the count of specific attribute

I was working on a application that allowed the user to update a status of work they are doing on a particular feature, in this case road signs.  The user has the ability to update a feature and set it's "Work Completed?" to Yes.  The map will automatically filter to signs that still need work, Work Completed set to No.
I also wanted to include a counter to show how many signs still need work done.

This is simple to do using dynamic text.  The problem I ran into is that when the user would update a feature, the count was not updating unless I refreshed the web page.  Turns out there is a refresh data interval setting that you can turn on in Experience builder.

First set up the dynamic text.

In EB create a view based on the attribute you want to count.  In my case it is 'Work Completed = Yes'
Select Data from left side.  Select your map, select the layer with the attribute.  On the Data views tab click Create a view:

KGalluccio_0-1745430638056.png

 

Add a clause under Filter and give it a name (naming is not required):

KGalluccio_1-1745430692287.png


Add a text widget and connect to the data source that you want to show a count on and set it to the view you just created:

KGalluccio_2-1745430799663.png

 

Select the text widget and click the Dynamic content button (stacked circles above the text widget)

In the Dynamic content widow select the Statistics tab.
Under Data it should list your feature layer and below that the view you just created.
Change Operator to Count.
Select OBJECTID as the field:

KGalluccio_3-1745431003746.png

 Click Insert.

The text box should now show the count:

KGalluccio_4-1745431059381.png

 

The last step is to turn on the refresh interval. 
Click the Data button again from the left side.
Select the web map and then the layer.
Below the Feature Layers link you should see "Refresh settings":

KGalluccio_5-1745431216380.png


Click the circle arrows to the right of Refresh settings.
Toggle on "Auto refresh" and change to Custom.
Update in minutes how often you want the data to refresh:

KGalluccio_6-1745431322742.png

 

Now when a user updates a record the count will reflect this change. 

Note:  this is not instantaneous and will only be as quick as the interval you entered.

 

Version history
Last update:
‎04-25-2025 12:11 PM
Updated by:
Contributors