<?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 How do I convert number field to string field? in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873153#M6356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ArcGIS Pro 2.2.4, I have a file geodatabase feature table where the ZIP code was imported as a long named "ZIP."&amp;nbsp; I need it&amp;nbsp;to be a string to 1) preserve leading zeroes and 2) join with another table on the ZIP field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I opened the attribute table and added a new field called "ZIPText" of type String.&amp;nbsp; I open Calculate Field and using Python 3, try to define ZIPText as !ZIP!.asString()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression validates, but when I run it, I get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 000539 File "&amp;lt;expression&amp;gt;", line 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 94501.asString()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with the carat pointing at the "g"&amp;nbsp;at the end of&amp;nbsp;asString.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried other expressions, but my Python is of the "google and try it variety" and Google's out of options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Apr 2019 01:53:22 GMT</pubDate>
    <dc:creator>MichaelHodnett1</dc:creator>
    <dc:date>2019-04-11T01:53:22Z</dc:date>
    <item>
      <title>How do I convert number field to string field?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873153#M6356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ArcGIS Pro 2.2.4, I have a file geodatabase feature table where the ZIP code was imported as a long named "ZIP."&amp;nbsp; I need it&amp;nbsp;to be a string to 1) preserve leading zeroes and 2) join with another table on the ZIP field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I opened the attribute table and added a new field called "ZIPText" of type String.&amp;nbsp; I open Calculate Field and using Python 3, try to define ZIPText as !ZIP!.asString()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression validates, but when I run it, I get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 000539 File "&amp;lt;expression&amp;gt;", line 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 94501.asString()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with the carat pointing at the "g"&amp;nbsp;at the end of&amp;nbsp;asString.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried other expressions, but my Python is of the "google and try it variety" and Google's out of options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 01:53:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873153#M6356</guid>
      <dc:creator>MichaelHodnett1</dc:creator>
      <dc:date>2019-04-11T01:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert number field to string field?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873154#M6357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;python parser...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;str(!ZIP!)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;and make sure the destination field is indeed text...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 02:19:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873154#M6357</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-04-11T02:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert number field to string field?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873155#M6358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since ZIPs are currently stored as long, there won't be any leading zeroes to preserve.&amp;nbsp; If you want to create them, you can use Python string formatting:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"{:0&amp;gt;5}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!ZIP!&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 15:08:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873155#M6358</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-04-11T15:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert number field to string field?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873156#M6359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ha! I knew it would be something that simple. It works perfectly.&amp;nbsp; Thank you sir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 17:20:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873156#M6359</guid>
      <dc:creator>MichaelHodnett1</dc:creator>
      <dc:date>2019-04-11T17:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert number field to string field?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873157#M6360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&amp;nbsp; I had intended to add the leading zeroes manually since there aren't that many, but this is a much better way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2019 17:20:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-do-i-convert-number-field-to-string-field/m-p/873157#M6360</guid>
      <dc:creator>MichaelHodnett1</dc:creator>
      <dc:date>2019-04-11T17:20:59Z</dc:date>
    </item>
  </channel>
</rss>

