<?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: Model failing to add text into calculated string field in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/model-failing-to-add-text-into-calculated-string/m-p/832873#M1174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use a string literal. Try this, VBScript will see something like: &lt;STRONG&gt;Left("test_poly", 5)&amp;nbsp;&lt;/STRONG&gt;at runtime:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;Left&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%Name%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&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;P&gt;&lt;/P&gt;&lt;P&gt;or better yet, use the Python parser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"%Name%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&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>Wed, 02 Oct 2019 03:31:50 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2019-10-02T03:31:50Z</dc:date>
    <item>
      <title>Model failing to add text into calculated string field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-failing-to-add-text-into-calculated-string/m-p/832872#M1173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In modelbuilder, I am trying to create a text field that will contain the first five characters of a feature class name. The model is as follows:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/460872_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;The adding of the field runs okay for each feature class that needs it, but the calculate field fails to populate the field with the leftmost five characters - the field remains empty. Here is the Calculate Field parameters:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/460873_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;Perhaps my VBscript code is off, yet no errors are thrown. I end up with empty SID fields for each feature class needing them populated with the leftmost 5 characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2019 17:49:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-failing-to-add-text-into-calculated-string/m-p/832872#M1173</guid>
      <dc:creator>MalcolmLittle</dc:creator>
      <dc:date>2019-10-01T17:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Model failing to add text into calculated string field</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-failing-to-add-text-into-calculated-string/m-p/832873#M1174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use a string literal. Try this, VBScript will see something like: &lt;STRONG&gt;Left("test_poly", 5)&amp;nbsp;&lt;/STRONG&gt;at runtime:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;Left&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%Name%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&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;P&gt;&lt;/P&gt;&lt;P&gt;or better yet, use the Python parser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"%Name%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&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>Wed, 02 Oct 2019 03:31:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-failing-to-add-text-into-calculated-string/m-p/832873#M1174</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2019-10-02T03:31:50Z</dc:date>
    </item>
  </channel>
</rss>

