A dependency is when an item needs another item to function properly. For example, if your web map has a layer, that layer is a dependency for the web map. Circular Dependencies are when items appear to link back to themselves. They may do so directly, or through a chain of connected items. Either way, the item thinks it is a dependency of itself. Items with circular dependencies can cause issues when you try to use them.
How do Circular Dependencies happen?
An item cannot legitimately be a dependency of itself. This mis-mapping occurs when something has broken with the item. An invalid relationship may have formed, causing the item to link back to itself. It can also occur when the item’s data JSON has been edited and one of the item IDs for a dependency was replaced with the item ID for the main item itself.
How can a Circular Dependency be fixed?
You can fix a circular dependency by editing the item’s data JSON. The easiest way to do this is by using Admin Tools for ArcGIS. The screenshots here are from the Pro version, but the functionality is included in the Free version of Admin Tools as well. We’ll go through an example of how to fix this below.
To start, find the item with the circular dependency in the table. Click on the arrow button in the third column, and a menu will appear. You will want to select “View / Edit Item Data”.
A modal will appear with a text-editor in it. The Item Info JSON will be pre-populated in the text edit. To fix the circular dependency, you must first shift the view to Item Data JSON. This can be done with the select box above the text-editor.
Once the Item Data JSON has been selected, the text-editor will update its contents. You will need to check the item ids for each of the dependencies to see which one matches the item id of the web map. In this example case, the ‘itemId’ property for the “Starbucks” layer has been edited to match the item id of the web map. To fix the circular dependency, we simply need to replace the property with the Starbucks layer’s actual item id (retrieved from our ArcGIS Organization). After editing the property, click the ‘Save’ button above the text-editor to apply the changes.
After the edits are successfully applied, the modal will display a success message. The item will have been updated in your ArcGIS Organization. If you do not immediately see the changes, you may need to clear your browser cache and refresh the web page to see the updates.
Note: If you are referencing the item in another product that caches your ArcGIS Organization, such as Backup My Organization or Clean My Organization, you will need to refresh your cache for the software to reflect the updates in your ArcGIS Org.
Did you find this article helpful? Would you like more helpful tricks, interesting guides, and other weekly updates from GEO Jobe? Then, subscribe to our blog or check out these recent articles: