Dynamic text works through the use of tags, similar to HTML. This allows you to combine both dynamic and static text in a single text element. Once dynamic text has been added to your layout, you can modify the text to change the information that is displayed and how it is shown. Along with dynamic text tags that provide the information displayed, you can use formatting tags to modify the formatting for portions of the text. This allows you to create mixed-format text where, for example, one word in a sentence is underlined.
Text elements using dynamic text tags can be as simple or complex as needed. In some cases, you may just need a single, stand-alone tag, but other cases may require several tags along with static text. The following is an example for keeping track of the last person to work on a project:
Last updated on <ITA><dyn type="project" property="dateSaved" format="long"/></ITA> by <ITA><dyn type="user"/></ITA>.
This example uses static text, two dynamic text tags, a modifier on the first tag to specify the date format, and two formatting tags to italicize the date and the user name. The output looks similar to the following: Last updated on Monday, June 9, 2014 by userName .
Note:
Text formatting tags are applied only if the current typeface includes that style.
Tables of dynamic text tags, formatting information for dynamic text, and examples of how to use these tags are provided below. For lists and examples of formatting tags, see Text formatting tags.
Numeric values
You can modify the number of decimal places used by tags that return numeric values using the decimalPlaces attribute. For example, <dyn type="mapFrame" name="MapFrameName" property="lowerMid" units="ddm" decimalPlaces="0"/> appears as -95 13 32 58, and <dyn type="mapFrame" name="Map Map Frame" property="lowerMid" units="ddm" decimalPlaces="2"/> appears as -95 13.29 32 57.68.
Empty strings
If a text element contains nothing but a dynamic text tag that currently parses to nothing, an empty bounding box appears on the layout when the element is selected.
If a text element contains additional static text, or an additional dynamic text tag that does parse to a value, that text appears. For example, if you have the following text on a layout that has never been exported: Last exported: <dyn type="layout" name="Layout" property="dateExported"/>, it appears as Last exported: on the page until the page has been exported.
However, if you want certain text to display when a tag parses to null, you can add emptyStr="<text>" to the dynamic text tag. For example, consider the following tag:
Credits: <dyn type="mapFrame" name="Map Frame" property="credits"/>
If the map contains no credit information, the result on the layout is Credits:. Using the empty attribute, you can set default text when there is no information available. For example:
Credits: <dyn type="mapFrame" name="<Map Frame Name>" property="credits" emptyStr="Credits for this map were unavailable."/>
The result on the layout is Credits: Credits for this map were unavailable.
Pre and post strings
Pre and post string attributes can be used to add text before or after a tag. The advantage of using these attributes over static text is that they only appear on the layout if the dynamic text tag has a value. For example, consider the following tag:
Date Exported: <dyn type="layout" name="Layout" property="dateExported" format="short"/>
If the layout has never been exported, the result on the layout is Date Exported:. Instead of adding an empty string attribute to explain that it has not been exported, you can remove the static text and add pre and post string attributes instead, so Date Exported: does not appear on the page.
<dyn type="layout" name="Layout" property="dateExported" format="short" preStr="Last exported on " postStr="."/>
This way, the text on the page is blank until the layout is exported. Once the layout has been exported, the text looks similar to the following:
Last exported on 2/11/2015.
New lines
To start a new line with a dynamic text tag, add the new line attribute. The tag looks similar to the following:
Date Saved <dyn type="project" property="dateSaved" format="short|short" newLine="true"/>
The result on the layout is:
Date Saved
1/27/2015 11:20 AM
System tags
The following table lists the available tags for system information:
System
Description | Example syntax | Example output |
---|---|---|
Computer Name | <dyn type="computer"/> | MYLAPTOP |
Current Date | <dyn type="date" format=""/> | 4/4/2019 |
Current Time | <dyn type="time" format=""/> | 10:20 AM |
User Name | <dyn type="user"/> | User |
Note:
Selecting Current Time from the Dynamic Text gallery on the Insert tab inserts a piece of text with both the current date and current time tags. The result in the Format Text pane is Current Time <dyn type="mapFrame" name="{0}" property="time" format="short|short"/>.
Project tags
The following tags are available for project information:
Project
Description | Example syntax | Example output |
---|---|---|
Name | <dyn type="project" property="name"/> | CityMaps |
Path | <dyn type="project" property="path"/> | C:\Users\UserName\Documents\ArcGIS\Projects\CityMaps\CityMaps.aprx |
Folder | <dyn type="project" property="folder"/> | C:\Users\UserName\Documents\ArcGIS\Projects\CityMaps\ |
Date Saved | <dyn type="project" property="dateSaved" format="short|short"/> | 4/4/2019 11:20 AM |
Default Folder | <dyn type="project" property="defaultFolder"/> | C:\Users\UserName\Documents\ArcGIS\Projects\CityMaps\ |
Default Geodatabase | <dyn type="project" property="defaultGeodatabase"/> | C:\Users\UserName\Documents\ArcGIS\Projects\CityMaps\CityMaps.gdb |
Default Toolbox | <dyn type="project" property="defaultToolbox"/> | C:\Users\UserName\Documents\ArcGIS\Projects\CityMaps\CityMaps.tbx |
Default Distance Units | <dyn type="project" property="distUnits"/> | Meters |
Default Angular Units | <dyn type="project" property="angularUnits"/> | Decimal Degrees |
Default Area Units | <dyn type="project" property="areaUnits"/> | Square Kilometer |
Default Page Units | <dyn type="project" property="pageUnits"/> | Centimeter |
Note:
Default Distance Units, Default Angular Units, Default Area Units, and Default Page Units can be changed by updating the unit options.
Project metadata
Description | Example syntax | Example output |
---|---|---|
Project Title | <dyn type="project" property="metadata" attribute="title"/> | City Project |
Project Summary | <dyn type="project" property="metadata" attribute="summary" /> | Data and maps for the city. |
Project Description | <dyn type="project" property="metadata" attribute="description"/> | All data and maps for the city from 2019. |
Project Tags | <dyn type="project" property="metadata" attribute="tags"/> | City, boundaries, utilities, parks, streets |
Project Credits | <dyn type="project" property="metadata" attribute="credits" /> | City GIS Office |
Project Use Limitations | <dyn type="project" property="metadata" attribute="use"/> | For display purposes only. |
Layout tags
The following tags are available for layouts:
Layout
Description | Example syntax | Example output |
---|---|---|
Date Exported |
<dyn type="layout" name="LayoutName" property="dateExported" format= "short|short"/> | 4/4/2019 11:00 AM |
Date Printed | <dyn type="layout" name="LayoutName" property="datePrinted" format= "short|short"/> | 4/4/2019 11:05 AM |
Metadata | When you select this option from the menu, a text element containing a set of metadata tags is inserted. See the layout metadata table for a breakdown. | |
Name | <dyn type="layout" name="LayoutName" property="name"/> | City Layout |
Service Layer Credits | <dyn type="layout" name="LayoutName" property="serviceLayerCredits"/> | Sources: Esri, HERE, Garmin, FAO, NOAA, USGS, © OpenStreetMap contributors, and the GIS User Community |
Note:
The Service Layer Credits tag displays the credits for all the map frames on the page.
Layout metadata
Description | Example syntax | Example output |
---|---|---|
Title | <dyn type="layout" property="metadata" attribute="title"/> | Minimal A3 Landscape |
Tags | <dyn type="layout" property="metadata" attribute="tags"/> | minimal, tabloid, landscape, layout, title, credits, template |
Summary | <dyn type="layout" property="metadata" attribute="summary"/> | A simple, A3-size landscape layout without any margins. It includes a map title and service layer credits. |
Description | <dyn type="layout" property="metadata" attribute="description"/> | A landscape layout ideal for showing countries, cities, and states. |
Credits | <dyn type="layout" property="metadata" attribute="credits"/> | Designed in 2019 by a cartographer. |
Use Limit | <dyn type="layout" property="metadata" attribute="uselimit"/> | For display purposes only. |
Map frame tags
Map frame tags display information about map frames and the maps they contain.
When you create a dynamic text tag for a specified map frame, the map frame is referenced by the name it has when the tag is created. For example, if the current default map frame is named My Map and you insert a dynamic text element for the scale, the tag is: <dyn type="mapFrame" name="My Map" property="scale"/>. If you later rename the map frame, the tag remembers the map frame it references, but the tag does not update to reflect the map frame's new name.
The following map frame tags are available:
Map frame
Description | Example syntax | Example output |
---|---|---|
Camera | When you select this option from the menu, a text element containing a set of camera tags is inserted. See the map frame camera table for a breakdown. | |
Credits | <dyn type="mapframe" name="MapFrameName" property="credits"/> | Created in 2019. |
Description | <dyn type="mapframe" name="MapFrameName" property="description"/> | Map showing the population of cities in 1970. |
Map Units | <dyn type="mapFrame" name="MapFrameName" property="mapUnits"/> | Meter |
Metadata | When you select this option from the menu, a text element containing a set of metadata tags is inserted. See the map frame metadata table for a breakdown. | |
Name | <dyn type="mapFrame" name="MapFrameName" property="name"/> | Map Frame |
Name of Map | <dyn type="mapFrame" name="MapFrameName" property="mapName"/> | Iceland map |
Reference Scale | <dyn type="mapFrame" name="MapFrameName" property="referenceScale"/> | 0 |
Relative Scale | 1 centimeter equals <dyn type="mapFrame" name="Map Map Frame" property="scale" pageUnits="cm" mapUnits="km" pageValue="1" decimalPlaces="2"/> kilometers This tag modifies the map's scale to be relative to the page. The attribute pageUnits is used to set the desired units in page space, such as inches or centimeters, and pageValue is used to set the number of these units used. The attribute mapUnits is used to set units for the map's scale. | 1 centimeter equals 0.08 kilometers |
Rotation | <dyn type="mapFrame" name="MapFrameName" property="rotation"/> | 90 |
Scale | <dyn type="mapFrame" name="MapFrameName" property="scale" preStr="1:"/> | 1:8,000 |
Center Scale | <dyn type="mapFrame" name="MapFrameName" property="centerscale" preStr="1:"/> This tag computes the scale at the center latitude and longitude of the associated map frame. | 1:6,854 |
Spatial Reference | When you select this option from the menu, a text element containing a set of spatial reference tags is inserted. See the spatial reference table for a breakdown. |
North
Description | Example syntax | Example output |
---|---|---|
True North | <dyn type="mapFrame" name="MapFrameName" property="trueNorth" units="dd" decimalPlaces="1" showDirections="false"/> | 0.2° |
Magnetic North | <dyn type="mapFrame" name="MapFrameName" property="magneticNorth" units="dd" decimalPlaces="0" showDirections="false"/> | -10° |
Map North | <dyn type="mapFrame" name="MapFrameName" property="gridNorth" units="dd" decimalPlaces="0" showDirections="false"/> | 0° |
Magnetic Declination | <dyn type="mapFrame" name="MapFrameName" property="magneticDeclination" units="dd" decimalPlaces="2" showDirections="false"/> Magnetic declination is the angle between true north and magnetic north. | -9.67° |
Convergence | <dyn type="mapFrame" name="MapFrameName" property="convergence" units="dd" decimalPlaces="2" showDirections="false"/> Convergence is the angle between true north and grid north. | 0.22° |
G-M Angle | <dyn type="mapFrame" name="MapFrameName" property="gmAngle" units="dd" decimalPlaces="2" showDirections="false"/> G-M angle is the angle between grid north and magnetic north. | -9.89° |
Map frame camera
Description | Example syntax | Example output |
---|---|---|
X | <dyn type="mapFrame" name="MapFrameName" property="camera.x" units="dms" decimalPlaces="0"/> | 46°8'3"E |
Y | <dyn type="mapFrame" name="MapFrameName" property="camera.y" units="dms" decimalPlaces="0"/> | 13°4'18"S |
Z | <dyn type="mapFrame" name="MapFrameName" property="camera.z"/> | 2,601,586.4995 |
Scale | <dyn type="mapFrame" name="MapFrameName" property="camera.scale" preStr="Scale: 1:"/> | Scale: 1:12,487,512 |
Rotation | <dyn type="mapFrame" name="MapFrameName" property="camera.rotation"/> | 5.03 |
Pitch | <dyn type="mapFrame" name="MapFrameName" property="camera.pitch"/> | -90 |
Roll | <dyn type="mapFrame" name="MapFrameName" property="camera.roll"/> | -90 |
Map frame metadata
Description | Example syntax | Example output |
---|---|---|
Title | <dyn type="mapframe" name="mapFrameName" property="metadata" attribute="title"/> | The World in 1970 |
Tags | <dyn type="mapframe" name="mapFrameName" property="metadata" attribute="tags"/> | population, map, 1970, world, historic map, |
Summary | <dyn type="mapframe" name="mapFrameName" property="metadata" attribute="summary"/> | World population map. |
Description | <dyn type="mapframe" name="mapFrameName" property="metadata" attribute="description"/> | Map showing the population of cities worldwide in 1970. |
Credits | <dyn type="mapframe" name="mapFrameName" property="metadata" attribute="credits"/> | Created in 2019. |
Use Limit | <dyn type="mapframe" name="mapFrameName" property="metadata" attribute="uselimit"/> | For educational purposes only. |
Spatial reference tags
Description | Example syntax | Example output |
---|---|---|
Name | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="name"/> | WGS 1984 UTM Zone 12N |
Projected Coordinate System | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="pcs"/> | WGS 1984 UTM Zone 12N |
Geographic Coordinate System | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="gcs"/> | GCS WGS 1984 |
Datum | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="datum"/> | WGS 1984 |
Projection | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="projection"/> | Transverse Mercator |
Remarks | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="remarks"/> | User Defined Geographic Coordinate System based on OSGB1936 |
Central Meridian | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="central meridian"/> | -111.0000 |
Latitude of Origin | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="latitude of origin"/> | 0.0000 |
Longitude of Origin | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="longitude of origin"/> | 0.0000 |
Latitude of Center | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="latitude of center"/> | 0.0000 |
Longitude of Center | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="longitude of center"/> | 0.0000 |
Latitude of 1st | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="latitude of 1st"/> | 0.0000 |
Latitude of 2nd | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="latitude of 2nd"/> | 0.0000 |
Longitude of 1st | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="longitude of 1st"/> | 0.0000 |
Longitude of 2nd | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="longitude of 2nd"/> | 0.0000 |
False Easting | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="false easting"/> | 500,000.0000 |
False Northing | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="false northing"/> | 0.0000 |
Standard Parallel 1 | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="standard parallel 1"/> | 0.0000 |
Standard Parallel 2 | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="standard parallel 2"/> | 0.0000 |
Scale Factor | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="scale factor"/> | 0.9996 |
Azimuth | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="azimuth"/> | 0.0000 |
Units | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="units"/> | Meter |
Authority | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="authority"/> | EPSG |
WKID | <dyn type="mapFrame" name="MapFrameName" property="sr" srProperty="wkid"/> | 3857 |
Map frame - coordinates
Description | Example syntax | Example output |
---|---|---|
Center | <dyn type="mapFrame" name="MapFrameName" property="center" units="dms" decimalPlaces="0"/> | 80°41'25"W 44°36'4"N |
X | <dyn type="mapFrame" name="MapFrameName" property="center.x" units="dms" decimalPlaces="0"/> | 80°41'25"W |
Y | <dyn type="mapFrame" name="MapFrameName" property="center.y" units="dms" decimalPlaces="0"/> | 44°36'4"N |
Lower Left | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft" units="dms" decimalPlaces="0"/> | 80°44'54"W 44°34'33"N |
Lower Middle | <dyn type="mapFrame" name="MapFrameName" property="lowerMid" units="dms" decimalPlaces="0"/> | 80°41'25"W 44°34'32"N |
Lower Right | <dyn type="mapFrame" name="MapFrameName" property="lowerRight" units="dms" decimalPlaces="0"/> | 80°37'57"W 44°34'32"N |
Middle Left | <dyn type="mapFrame" name="MapFrameName" property="midLeft" units="dms" decimalPlaces="0"/> | 80°44'53"W 44°36'5"N |
Middle Right | <dyn type="mapFrame" name="MapFrameName" property="midRight" units="dms" decimalPlaces="0"/> | 80°37'57"W 44°36'3"N |
Upper Left | <dyn type="mapFrame" name="MapFrameName" property="upperLeft" units="dms" decimalPlaces="0"/> | 80°44'53"W 44°37'36"N |
Upper Middle | <dyn type="mapFrame" name="MapFrameName" property="upperMid" units="dms" decimalPlaces="0"/> | 80°41'25"W 44°37'36"N |
Upper Right | <dyn type="mapFrame" name="MapFrameName" property="upperRight" units="dms" decimalPlaces="0"/> | 80°37'56"W 44°37'35"N |
To break the coordinate down into parts, append .x or .y to the property you specified. You can format how coordinate values display using the format tags below.
Decimal Degree Parts
Format | Description | Example syntax | Example output |
---|---|---|---|
dd | Decimal Degrees | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dd" decimalPlaces="2" showDirections="True"/> | 122.31W |
dd.deg | Degrees | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dd.deg" decimalPlaces="2" showDirections="True"/> | 122.31 |
dd.deg.int | Degree Integer | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dd.deg.int" decimalPlaces="2" showDirections="True"/> | 122 |
dd.deg.sym | Degree Symbol | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dd.deg.sym" decimalPlaces="2" showDirections="True"/> | ° |
dd.dec | Decimal | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dd.dec" decimalPlaces="2" showDirections="True"/> | 31 |
dd.dir | Direction | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dd.dir" decimalPlaces="2" showDirections="True"/> | W |
Degree Minute Second Parts
Format | Description | Example syntax | Example output |
---|---|---|---|
dms | Degrees Minutes Seconds | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms" decimalPlaces="2" showDirections="False"/> | -122°18'37.82" |
dms.deg | Degrees | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms.deg" decimalPlaces="2" showDirections="True"/> | 122 |
dms.deg.sym | Degree Symbol | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms.deg.sym" decimalPlaces="2" showDirections="True"/> | ° |
dms.min | Minutes | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft" units="dms.min" decimalPlaces="2" showDirections="True"/> | 18 |
dms.min.sym | Minutes Symbol | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms.min.sym" decimalPlaces="2" showDirections="True"/> | ' |
dms.sec | Seconds | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms.sec" decimalPlaces="2" showDirections="True"/> | 37.82 |
dms.sec.sym | Seconds Symbol | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms.sec.sym" decimalPlaces="2" showDirections="True"/> | " |
dms.sec.int | Seconds Integer | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft" units="dms.sec.int" decimalPlaces="2" showDirections="True"/> | 37 |
dms.sec.dec | Seconds Decimal | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms.sec.dec" decimalPlaces="2" showDirections="True"/> | 82 |
dms.dir | Direction | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="dms.dir" showDirections="True"/> | W |
Decimal Minute Parts
Format | Description | Example syntax | Example output |
---|---|---|---|
ddm | Decimal Minutes | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="ddm" decimalPlaces="2" showDirections="True"/> | 122°18.63 W |
ddm.deg | Degrees | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="ddm.deg" decimalPlaces="2" showDirections="True"/> | 122 |
ddm.min | Minutes | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft.x" units="ddm.min" decimalPlaces="2" showDirections="True"/> | 18.63 |
ddm.min.int | Minutes Integer | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft" units="ddm.min.int" decimalPlaces="2" showDirections="True"/> | 18 |
ddm.min.dec | Minutes Decimal | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft" units="ddm.min.dec" decimalPlaces="2" showDirections="True"/> | 63 |
ddm.deg.sym | Degree Symbol | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft" units="ddm.deg.sym" decimalPlaces="2" showDirections="True"/> | ° |
ddm.dir | Direction | <dyn type="mapFrame" name="MapFrameName" property="lowerLeft" units="ddm.dir" decimalPlaces="2" showDirections="True"/> | W |
If your map frame contains time-enabled data you can display time information using dynamic text.
Map frame - time
Description | Example syntax | Example output |
---|---|---|
Start Time | <dyn type="mapFrame" name="MapFrameName" property="startTime" format="short|short"/> | 1/1/2001 12:00 AM |
Current Time | <dyn type="mapFrame" name="MapFrameName" property="time" format="short|short"/> | 1/1/2004 12:00 AM to 1/1/2006 12:00 AM |
End Time | <dyn type="mapFrame" name="MapFrameName" property="endTime" format="short|short"/> | 1/1/2010 12:00 AM |