<?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: How do I test if a domain exists? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61732#M2182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In 10.1, there is a new data access Python module that has a &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/ListDomains/018w0000001z000000/"&gt;ListDomains&lt;/A&gt;&lt;SPAN&gt; function that returns &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000020000000"&gt;Domain&lt;/A&gt;&lt;SPAN&gt; objects. Domain objects have all the properties of the domain, not just the name. ListDomains is far superior to describing a workspace object.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Dec 2012 16:20:50 GMT</pubDate>
    <dc:creator>DaleHoneycutt</dc:creator>
    <dc:date>2012-12-19T16:20:50Z</dc:date>
    <item>
      <title>How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61726#M2176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi folks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Simple question, I cannot figure out how to gracefully check if a domain exists in a file geodatabase using Python with ArcGIS 9.3.1 SP2.&amp;nbsp; I can try to create the domain afresh and then catch the error but seems like something I should be able to test for.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Oct 2010 15:46:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61726#M2176</guid>
      <dc:creator>PaulDziemiela</dc:creator>
      <dc:date>2010-10-26T15:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61727#M2177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Describe the workspace - the returned describe object has a list of domains.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Workspace_properties"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Workspace_properties&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Oct 2010 16:18:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61727#M2177</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2010-10-26T16:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61728#M2178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can wrap that up into an exists function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Oct 2010 09:51:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61728#M2178</guid>
      <dc:creator>PaulDziemiela</dc:creator>
      <dc:date>2010-10-27T09:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61729#M2179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Long after the fact, but this thread very nearly answers my question...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to make a conditional statement happen if a domain doesn't yet exist.&amp;nbsp; In other words, if the domain "GOES_TO" does not exist, I don't want it be (unsuccessfully) created in the next step.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;desc = arcpy.Describe(gdb_path)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; domains = desc.domains&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for domain in domains:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if domain == "GOES_TO":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isitthere = "yes"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isitthere = "no"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if isitthere == "no":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #create the new domain, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code doesn't work because as the list goes through each domain, all of them but one are not called "GOES_TO", which means that isitthere will always equal "no".&amp;nbsp; But at least you can see what I'm trying to do...&amp;nbsp; I feel like there's something obvious that I'm missing...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 16:23:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61729#M2179</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2012-12-18T16:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61730#M2180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
isthere = False
for domain in domains:
&amp;nbsp; if domain == "GOES_TO":
&amp;nbsp;&amp;nbsp;&amp;nbsp; isthere = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; break

if not isthere:
&amp;nbsp; # do something
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:20:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61730#M2180</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2021-12-10T22:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61731#M2181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes, that is what I was missing.&amp;nbsp; I appreciate the quick answer.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 18:55:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61731#M2181</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2012-12-18T18:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61732#M2182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;FYI:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In 10.1, there is a new data access Python module that has a &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/ListDomains/018w0000001z000000/"&gt;ListDomains&lt;/A&gt;&lt;SPAN&gt; function that returns &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000020000000"&gt;Domain&lt;/A&gt;&lt;SPAN&gt; objects. Domain objects have all the properties of the domain, not just the name. ListDomains is far superior to describing a workspace object.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 16:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61732#M2182</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2012-12-19T16:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I test if a domain exists?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61733#M2183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah, I found that out in another thread.&amp;nbsp; I'm using 10.0 though, so I'll have to wait for an upgrade to use ListDomain.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 18:32:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-test-if-a-domain-exists/m-p/61733#M2183</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2012-12-19T18:32:21Z</dc:date>
    </item>
  </channel>
</rss>

