Select to view content in your preferred language

Pro: Do not display timestamp in layer display field if date is in display expression and timestamp not populated (like ArcMap)

1191
3
04-07-2021 02:09 PM
Status: Already Offered
Labels (1)
DanielleKulas
Frequent Contributor

When working with a geodatabase feature class containing a date field, ArcMap does not display the timestamp if the date field is used in a display expression and the timestamp is not populated.

Pro seems to respect this convention in the attribute table, in that the timestamp is not shown if it is not populated in the date field. It also does not display the timestamp in the Display if the timestamp is not populated and the date field *is* the display field by itself. But, if that same date field is used in a Display field expression within layer properties, the timestamp is displayed even if it's not populated. 

I'm not sure if there's something I'm fundamentally not understanding about Arcade expression and/or timestamps but this also seems like it could be an oversight. Here's what my display expression looks like in ArcMap: 

DanielleKulas_2-1617829261533.png

Sample result: Central Appalachian Basic Ash - Hickory Woodland-ALBE013-05/09/2011. This is the desired outcome since the timestamps are not populated in the date field.

And in Pro, on the same dataset: 

DanielleKulas_1-1617829245319.png

Sample result: 

DanielleKulas_3-1617829346421.png

This is not the desired result and different from the behavior in ArcMap.

Can this be implemented in a future release of Pro (or if I'm totally missing something, could you please steer me in the right direction)? I searched other posts before creating this idea but couldn't find anything similar.


Thanks!

 

3 Comments
KoryKramer

Hi @DanielleKulas Note that ArcMap is using the Python parser while Pro is using Arcade.  While different, what this allows is for these expressions to work across ArcGIS (in web maps, etc.)

Try $feature.COMM_TYPE + '-' + $feature.PLOT + '-' +Text($feature.Date, 'MM-DD-Y')

KoryKramer_0-1617833626496.png

 

KoryKramer_1-1617833670463.png

The formats for text functions are specified here: https://developers.arcgis.com/arcade/function-reference/text_functions/

Hope this helps!

DanielleKulas

@KoryKramer Thank you so much, that's perfect! I was hoping it was something simple 🙂 Much appreciated.

KoryKramer
Status changed to: Already Offered

Glad that works for you!