I'm using data driven pages (ArcGIS version 10.4), and I want to use dynamic text to create neighbor labels with the text "MATCH LINE SHEET" before the page number. I've used the Insert --> Dynamic Text --> Data Driven Page Name, and put the following in the dialog box:
<dyn type="page" property="PageNum_S" preStr="MATCH LINE SHEET "/>.
This gives me "MATCH LINE SHEET 4" when the field "PageNum_S" in the data driven pages index layer has a value of 4 for the page. However, the text "MATCH LINE SHEET" is showing up even when there is no value in that field for that page (i.e. the map sheet is an edge sheet and there are no adjoining pages in that direction).
According to the Esri online article "Using dynamic text with Data Driven Pages," the text ought to disappear when there is no value:
"The preStr and postStr tag attributes let you specify text to add to the start or end of a parsed dynamic tag. These only appear when the corresponding dynamic tag has a value."
Why is my preStr text still appearing, and how can I get it to disappear when there is no value?
As you entered the text manually it does not disappear.
I got around it by creating 4 Fields in my Data Driven page feature class. ToNorth, ToEast, ...etc and populating the fields.
Kind of cumbersome to set up. But I did it for one of my clients when data driven pages first became a thing and only have to make changes when new map sheets are added or removed. Which in reality is not terribly often.
I then display them as a data driven page attribute.