Solved! Go to Solution.
domainDict = {1:"Foo Type",2:"Bar Type",3:"Other Thing"} alias = domainDict[mxd.dataDrivenPages.pageRow.getValue("YourFieldName")] yourElement.text = alias
I am creating a map book with data driven pages, using dynamic text with an attribute field with the help tip below...
TIP:
With the dyn type="page" you can create dynamic text with any attribute field of the Data Driven Pages index layer. For example, if you have an attribute on the index layer named POPULATION, you can create a dynamic text tag using this field, <dyn type="page" property="POPULATION"/> to dynamically display the POPULATION values for each page in the layout.
With this functionality if you have an attribute field in an index layer of your data driven pages you can use it as dynamic text for the pages
I have tried it with a field that uses a coded subtype, and just the numeric code will show - is there any way to display the coded value instead?
Thanks!
Adding the "domainlookup="true"/" on mine sorted my issues of the DD attributes only showing the coded values. Was driving me nuts, but now sorted to this one bit of script I add manually to each Attribute tag (not sure why I have to do this manually though).
I am running ArcGIS 10.0...
using Insert-> text-> then editing in properties box - used the format you put down and still just gave me the numeric code.
domainDict = {1:"Foo Type",2:"Bar Type",3:"Other Thing"} alias = domainDict[mxd.dataDrivenPages.pageRow.getValue("YourFieldName")] yourElement.text = alias