Select to view content in your preferred language

Number Formatting and Units in the Text Widget

262
1
10-02-2024 10:45 AM
Labels (1)
CaseyP-GIS
New Contributor

How do the units in the Text widget work for dynamic content?

For example, I'm using the dynamic content to divide one field by another to generate percentage values. Right now, I have just manually put in a "%" after the expression. But, I'd like the text to just read "No Data" if the expression can't calculate (rather than "Expression 1"). I learned that you can do this by renaming the expression. So, I renamed the expression to "No Data".

Except now, when there is an error, it reads "No Data%" because I've placed the "%" there manually. I figured, hey, I'll just use "%" as my unit, maybe that'll make it so it doesn't show when there's no data. But clicking the gear on the dynamic content pane, turning on number formatting, and checking the box for "Unit" does absolutely nothing. Where do I input my unit?

Thanks!

0 Kudos
1 Reply
NicoleJohnson
Regular Contributor

I'm not sure how to get the units to work, but you can just add a percentage sign to your expression like so (ignore the overlapping text edit bar lol):

NicoleJohnson_1-1728651999661.png

Re: units, the documentation just says, "You can choose the number of decimal places to show, include a thousands separator, and add a unit from the data." It must be something you set up at the data level, maybe even before publishing (I'm not seeing any options in Enterprise 11.2 to set units for a field in an already-published hosted feature layer, for example).

0 Kudos