Select to view content in your preferred language

Hide Variable/Curly Bracket Until Selected

5564
22
04-07-2020 06:20 AM
DevinLavigne
Frequent Contributor

In the Text Widget/Dynamic Text is there a way to hide the variable and the curly brackets until something is selected? Or a way to write an expression - i.e. If {County} = "" Then "" Else {County}? Seems like this should be easy but I'm not seeing anything. Thanks.

0 Kudos
22 Replies
DavidMartinez
Esri Regular Contributor

Until we support more expressions to manage what is shown in the text widget here is a workaround: 

Use a default in the text box and use view for empty selection in the feature layer under the data panels so it uses default values if nothing is selected. By design, it will pull in the first record from the feature layer. You could have that record blank if nothing is selected. For example, the animated gif below has a default value for Washington D.C. if nothing is selected. 

viewforemptyselection.gif

 

Cheers,

 

David

BrianBaldwin
Esri Regular Contributor

Great work around @DavidMartinez - I honestly had never seen those settings in the feature layer configuration for ExB.

-----------------------------------

Brian Baldwin, Esri Inc., Lead Solution Engineer
https://www.linkedin.com/in/baldwinbrian
0 Kudos
rzufelt
Frequent Contributor

Hi David,

Could you elaborate on how you are doing this?

I have a text widget using dynamic text on selected features.  I have tried both Statistics and Expression to get the count of selected features.  Seems to be working fine until the Count result = 0, then it just shows the Expression used.

If I have 2 features selected, the text widget displays:

"Selected Features: 2"

However, if there is no selection (I.e., selected feature count = 0), it displays:

"Selected Features: COUNT({OBJECTID}) "

How do I make this show the "actual" count of selected features?

It should report:

"Selected Features: 0"

 

Thanks,

 

R_

0 Kudos
DavidMartinez
Esri Regular Contributor

Hi,

I am including a couple of my colleagues below that could better assist you as I am no longer working on ExB these days. @DanJiang @WeiYing1 .

Cheers,

David

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi,

You can use Expression instead of Statistics, and use "0" for the expression title.

ShengdiZhang_0-1642125262324.png

Shengdi

rzufelt
Frequent Contributor

Thanks Shengdi,

I tried the expression, but didn't think to rename it and didn't like "Expression 1" result when zero.

Though, I still think this is a bug (since the "count" actually is zero and not being reported), this workaround does the trick.

R_

0 Kudos
EmilioGonzalezAlvarez
New Contributor

Thanks Shengdi, it works!

0 Kudos
ChristopherMask
Regular Contributor

So simple, and exactly what I needed! 

0 Kudos
ccharping_patrickco
Occasional Contributor

I agree. I'm attempting to implement @DavidMartinez 's workaround solution but would like to see a setting that could be enabled with a configurable "no data message" similar to the Feature Info configuration. Another potential solution would be for the Feature Info Widget to have more configurations that allow field visibility, alias, arrangement, and disabling functions such as the next arrows and feature counts.

0 Kudos
DavidMartinez
Esri Regular Contributor

In our next release, you will be able to use Feature info with selected features. For example, it will only show when you select an item on the map. When no item is selected on the map it will have the no data message. In this scenario, there are no feature counts or arrows. 

Cheers,

 

David

0 Kudos