Select to view content in your preferred language

Dynamic content - How to return count of all features (if none selected)?

1469
2
Jump to solution
11-02-2023 10:16 AM
JohnW7
by
Emerging Contributor

Hello,

I'm trying to implement a simple indicator using a text widget. When no features are selected I want to display the count of all features.  When features are selected, I want to show the number selected. 

I can do each of these individually, but can't figure out how to implement this using only one text widget.

This is very straightforward when creating dashboards, but I need editing capabilities so I need to use Experience Builder. 

I've spend a ridiculous amount of time trying to figure this out.  Any suggestions would be greatly appreciated!

Thanks,

John

0 Kudos
1 Solution

Accepted Solutions
JeffreyThompson2
MVP Regular Contributor

JeffreyThompson2_0-1698950375546.png

In the Data panel, go to the bottom and check the box for View For Empty Selection. In the Dynamic Content, set your data to Selected Features. This should make the number display the total count with no selection and the selected features count when selected. If you want to change the text around the number, I think you will need a custom widget.

GIS Developer
City of Arlington, Texas

View solution in original post

2 Replies
JeffreyThompson2
MVP Regular Contributor

JeffreyThompson2_0-1698950375546.png

In the Data panel, go to the bottom and check the box for View For Empty Selection. In the Dynamic Content, set your data to Selected Features. This should make the number display the total count with no selection and the selected features count when selected. If you want to change the text around the number, I think you will need a custom widget.

GIS Developer
City of Arlington, Texas
JohnW7
by
Emerging Contributor

Wow, so simple. I can't thank you enough. I can't believe I missed that. I was expecting such an option to be under the widget settings. Thanks again!

0 Kudos