I'm trying to convert an entire field to be 'proper' inside of a popup. When you configure a custom popup it's all done in HTML. It's easy in python or even arcade, but ESRI forces it to be in HTML. I'm seeing ways to change it through CSS, but not within just the HTML window. Any ideas?
Here's the code:
{caution_notes}
Can you expand on what you mean by proper? The image you embedded will display anything thats written/stored in your Caution_Notes field.
What kind of formatting are you hoping to achieve? What kind of information is stored in the Caution_Notes field?
I should have been more clear. The field is about a paragraph in all CAPS. Ideally I would like it to only capitalize after a sentence ends. I'm trying to make it readable by making it 'proper' case. Here is the link to achieve it in JavaScript, Python, VBScript and Arcade: Specify text for labels—ArcGIS Pro | ArcGIS Desktop. Here is the example from the link using 'proper' case.
Proper($feature.NAME, 'firstword')
Python
def FindLabel ( [NAME] ): S = [NAME] S = S.title() return S
VBScript
Function FindLabel ( [NAME] ) FindLabel = UCase(Left([NAME],1)) & LCase(Right([NAME], Len([NAME]) -1)) End Function
JScript
function FindLabel ( [NAME] ) { var str = [NAME]; var iLen = String(str).length; var upper = (str.substring(0,1)).toUpperCase(); var lower = (str.substring(1, iLen)).toLowerCase() return upper + lower; }
For custom popups, there is only the option for HTML. A lot of data is recorded in CAPS so I'm surprised to not see something like this out of the box. Any ideas on formatting?
I'm not the most savvy with writing code but you can do something similar to the last sample with Arcade by creating an expression in the pop up configuration:
Create an expression with this:
Proper ($feature.City, 'firstword')
Where in my example, I have a field called City. Then you can use that expression like a field in your custom popup. It will also appear in the table.
Mike
I can't create an expression in python, JScript or arcade. The expression must be in HTML.
Sorry, I misunderstood your post. The arcade expression I suggested will not work in HTML.
Mike