Select to view content in your preferred language

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

2477
4
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 Frequent 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

4 Replies
JeffreyThompson2
MVP Frequent 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
clkstngisanalyst
New Contributor

Hi! Literally doing the same currently but it's showing an inaccurate count for all. You can see in the table that number should be over 62,000 and not 100. The total values are correct and will change according to selection. The parcel count will only show correctly when I change the expression to just default. Any suggestions?

(Ignore the font differences. I'm just going back and forth between expressions before I commit lol.)

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

Please post this as a separate question for better visibility and clarity.

GIS Developer
City of Arlington, Texas
0 Kudos