I am trying to have some labels turn on and off dynamically with the data driven page being displayed, but it is not working.

First, I have a data driven index layer moving from map to map, called "DD_Index". This is working. It is a list of parks driven off the field "PARK"

Second I have a second layer of the FC used for the data driven index, named "Little Park Label Layer", definition queried to only show a single record, in this case a specific park named "Little Park", which is a value in the data driven index field "PARK". This layer also has a Page Definition enabled with the Page Name Field set to "PARK" and "Match" enabled

Third I have an annotation group in the MXD called "Little Park Labels", it is set with Associated Layer of "Little Park Label Layer"

The theory being when the data driven index gets to "Little Park" the page definition turns on the "Little Park Label Layer", which in turn turns on the associated annotation group "Little Park Labels".

I can test turning the labels on and off with the associated layer manually and it works. I turn on the "Little Park Label Layer" and the labels in the annotation group display. All good there.

However if I enable data driven pages and go to the page "Little Park" the "Little Park Label Layer" is not turning on, therefore the labels are not turning on.

Is there an issue with using a definition queried duplicate layer of the index to drive this?

  • 2
    I don't think data driven pages can be used to turn layers on or off. It only selects which features in a layer are displayed - according the the page definition for that layer. It will either show the features that match, or the features that don't match (according to the page definition). Apr 10, 2019 at 5:38

1 Answer 1


You can achieve the desired outcome if you have access to create annotations within the same database that the source feature class is stored in. It won't work in the annotations are stored in the map, as they are not a layer that you can set a page definition on.

Once you have your annotations stored in a database, and as a layer on the map, set a page definition on the annotation layer itself based on the annotation's 'TextString' attribute.

NB: This requires that all annotations are placed (make sure the labels are all visible when you create the annotations). You may need to turn off data driven pages on the source layer when you convert the labels to annotations, and configure placement properties to make sure that all labels get placed as annotations.

I have found that this can fail if the label placement configuration uses stacking or any other setting that can change the text of the label. Eg, if using the Maplex label engine and you allow label stacking (ie, split the label into multiple lines), this will not work, as the Annotation 'TextString' will not match the original label attribute text due to the newlines included in it.

  • If it is matching on TextString, shouldn't that pick only one label, unless for some reason there are multiple labels for Little Park that have the same text?
    – danak
    Apr 11, 2019 at 23:39
  • Yes. I'm assuming that's what was desired. Not entirely certain though. Apr 12, 2019 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.