Hi,
I'm looking to escape special characters when using Dynamic attribute text with Data Driven Pages using ArcGIS Pro. I have some attribute values that include amphersands and it's throwing my formatting expressions for a loop. I know with map labels it's pretty easy to escape them by using a python expression however I'm not sure how to do this with dynamic text on the layout. Any suggestions?
Hi Andrew,
I'm not sure exactly what your workflow is, but you mention an attribute table. If you are grabbing information from a table you may want to consider using Table dynamic text - see Add and modify dynamic text—ArcGIS Pro | Documentation (about a third of the way down the topic is Table dynamic text). With Arcade - ArcGIS Arcade | ArcGIS for Developers - you can further customize your text.
For example, I have a table of world countries that has fields for both country name and continent and I want a dynamic text element that displays the country's name along with which continent the country is in formatted like "X is in Y". I can use a Table dynamic text element ("Table Attribute" from the "Dynamic Text" gallery on the ribbon provides access to your attribute) and use an Arcade expression to customize the text.
I'm far from being an Arcade expert, but there is lot you can do. Table dynamic text ("Table Attribute") also works with map series.
Inserting format tags within the dynamic element is not supported. You can place formatting tags around the dynamic tag. For example, here is a dynamic text element for the date the project was saved. You see static text - "Date Saved:" and a dynamic tag - "dateSaved".
If I want the date to be bold I can add formatting tags around the dynamic tag.
Here's how the element looks in Text View.
The dynamic part of the element is prefaced with "< dyn type=". Within this dynamic tag you see its parts - <dyn type="project" property="dateSaved" format="short|short"/>. This particular dynamic text element provides a format option. This allows me an option to show only the date.
There is a limit to what you can do within a dynamic text tag. For more information on this, please see - Dynamic text tags—ArcGIS Pro | Documentation
Hope this helps,
Tom
HI Jay,
Yes - the dynamic text works just fine until I add some formatting tags like <FNT></FNT> or <BOL></BOL>
Displays As Intended:
Displays Incorrectly (Dynamic Text contains "&"):
Try adding some formatting tags to your dynamic text and see if you experience the same.
Thanks,
Andrew
Can you provide a screen shot or example? In Pro 2.6, when I insert an Attribute as Dynamic Test in my Data Driven Pages map book, an attribute value including an & works just fine. What formatting are you trying to apply that is getting messed up?
Thanks, Dan. This works great when labeling features on the map however I'm talking about Dynamic Text on the layout. I don't see a way to use these types of expressions when it comes to Dynamic Text. One thing I do not want to do is go in and modify my Attribute table in order to get it to work.
don't know if your situation applies to this, but the formatting info might be useful
https://community.esri.com/thread/258472-special-characters-with-text-formatting-tags
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.