Is This Content Helpful?
We're glad to know this article was helpful.
Sometimes documents that must be hyperlinked to features are organized into several subfolders. This is typically done to organize large amounts of data into more manageable smaller folders. One challenge with organizing documents in this way is that it can create confusion when trying to hyperlink features to documents that could be in any of the subfolders of a parent directory. The following workflow is one method to recursively iterate through a directory to find and display documents that are associated with a feature, all through a Python script.
In this example, the parent directory is called 'Parcels', but there are several subfolders underneath, breaking the Parcels down by zip code. This was done to better organize the data, but can cause confusion when creating hyperlinks in ArcMap. The hyperlinked file is a .jpeg image of the front of the property, and is named by using the Parcel ID.
import webbrowser, os
for r,d,f in os.walk(r"\\serverName\Parcels"):
for image in f: