What is a Circular Dependency

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 (either directly or through a chain). The item thinks it is a dependency of itself. Items with circular dependencies can cause issues when you try to use them.

What Causes Circular Dependencies?

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 to Fix a Circular Dependency

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.

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”.

An image of the 'Browse Items' page in Admin Tools for ArcGIS. A table is displayed with information about several items. The third column on each row features a button with a drop-down arrow. Upon clicking it, a menu appears with several options. In the screenshot, a gold rectangle highlights the 'View - Edit Item Data' option
Select the “View / Edit Item Data” option for the item with the circular dependency

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.

A screenshot of the 'View - Edit Item Data' modal. Most of the screen is a text-editor with the Item Info Json. Above the text editor are various controls, including a select box for shifting the content displayed in the text editor. A gold box highlights this select box. Within the text editor, one of the properties displayed is the item's id. A gold bar underlines this property.
Note the web map’s id (underlined). We’ll see this again shortly.

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. Please note, you may need to clear your browser cache and refresh the web page to see the updates.

Additional 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.