<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Find datasets associated with mxd's in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224343#M12752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One note on the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;dataSource&lt;/SPAN&gt; property of a layer I've found while doing this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Not all layers support the dataSource property (for example, annotation classes and web services), so it is good practice to test for this ahead of time using the supports method.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;supports&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DATASOURCE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;‍
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Map: {} Layer: {} Data Source: {} Broken?:{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataSource&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isBroken&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 10:55:50 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2021-12-11T10:55:50Z</dc:date>
    <item>
      <title>Find datasets associated with mxd's</title>
      <link>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224341#M12750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We need to have a data clear out, and want to find which datasets are associated with numerous mxd's.&amp;nbsp; Does anyone know if there is an automatic way of listing the associated dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would also be good if we could flag up if the dataset link is valid or a broken link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has any ideas or suggestions on how this could be achieved then it would be good to hear from you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 09:27:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224341#M12750</guid>
      <dc:creator>AndrewIngall1</dc:creator>
      <dc:date>2016-09-14T09:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find datasets associated with mxd's</title>
      <link>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224342#M12751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can automate this with ArcPy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of a script that:&lt;/P&gt;&lt;P&gt;1. Gathers all of the mxds in a workspace&lt;/P&gt;&lt;P&gt;2. Iterates through each mxd&amp;nbsp;and lists all of the layers in the mxd&lt;/P&gt;&lt;P&gt;3. Prints out a message about each layer (including the path to the data source and if the link to the data source is broken)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os

&lt;SPAN class="comment token"&gt;#Set the workspace where you will list all of the MXDs&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Path\to\Workspace"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Loop through each mxd in the workspace&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; mxd &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFiles&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*.mxd"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#Create path to the workspace&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; mxd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#Create a map document object&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#List all of the layers in the map document&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; lyrs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;m&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#Loop through each layer in the map document and print out a message&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lyrs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Map: {} Layer: {} Data Source: {} Broken?:{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataSource&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isBroken&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here are some links to the documentation that you may find useful:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/listfiles.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListFiles&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/mapdocument-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;MapDocument&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/listlayers.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListLayers&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Layer&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Folks&amp;nbsp;in the&amp;nbsp;&lt;A href="https://community.esri.com/space/2145" target="_blank"&gt;Python&lt;/A&gt;‌ group may have other suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:55:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224342#M12751</guid>
      <dc:creator>BrittneyWhite1</dc:creator>
      <dc:date>2021-12-11T10:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find datasets associated with mxd's</title>
      <link>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224343#M12752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One note on the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;dataSource&lt;/SPAN&gt; property of a layer I've found while doing this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Not all layers support the dataSource property (for example, annotation classes and web services), so it is good practice to test for this ahead of time using the supports method.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;supports&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DATASOURCE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;‍
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Map: {} Layer: {} Data Source: {} Broken?:{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dataSource&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isBroken&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:55:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224343#M12752</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-11T10:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Find datasets associated with mxd's</title>
      <link>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224344#M12753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can check out my &lt;A href="https://community.esri.com/blogs/myAlaskaGIS/2015/08/31/python-addin-for-data-inventory-and-broken-link-repair?sr=search&amp;amp;searchId=bb8547e1-e436-4369-8c02-3fd64b2c2af0&amp;amp;searchIndex=4"&gt;/blogs/myAlaskaGIS/2015/08/31/python-addin-for-data-inventory-and-broken-link-repair?sr=search&amp;amp;searchId=bb8547e1-e436-4369-8c02-3fd64b2c2af0&amp;amp;searchIndex=4&lt;/A&gt;‌ which might help.&amp;nbsp; One of the tools just takes inventory of datasources.&amp;nbsp; Feel free to grab the script and modify if needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 17:05:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/find-datasets-associated-with-mxd-s/m-p/224344#M12753</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-09-28T17:05:04Z</dc:date>
    </item>
  </channel>
</rss>

