<?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: get field value returns 1 in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804189#M3835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if it is due to the join? Maybe put in an export to temporary table then do the get field? Just an idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 May 2015 10:46:21 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2015-05-07T10:46:21Z</dc:date>
    <item>
      <title>get field value returns 1</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804188#M3834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone have thoughts about why the Get Field Value tool would return "1" instead of the first value of the specified field? In many cases Get Field Value does what it should - it returns the expected value. In a few cases it returns "1" which is not even a choice in the specified field. The field referenced by Get Field Value uses a sting data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the process string that uses the Get Field Value tool:&lt;/P&gt;&lt;P&gt;Select Layer by Location &amp;gt; Make Feature Layer &amp;gt; Summary Statistics &amp;gt; Add Join &amp;gt; Get Field Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate Field calls Get Field Value's output using the format "%inline_variable%".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help,&lt;/P&gt;&lt;P&gt;Paul Lohr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 10:39:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804188#M3834</guid>
      <dc:creator>PaulLohr</dc:creator>
      <dc:date>2015-03-18T10:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: get field value returns 1</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804189#M3835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if it is due to the join? Maybe put in an export to temporary table then do the get field? Just an idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 10:46:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804189#M3835</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2015-05-07T10:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: get field value returns 1</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804190#M3836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul, without the whole model and test data it's really hard to tell what is happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing i'm wondering is the data type of the field you're calculating with Calculate Field and the field involved in the join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing that I'm also wondering is whether something may be causing something to be interpreted as boolean. ("1" means True).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 05:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804190#M3836</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2015-05-13T05:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: get field value returns 1</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804191#M3837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Curtis and Duncan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a long history with ESRI technical support on this issue. The case number is 01619965. Of course most folks won't be able to read the incident history aside from ESRI employees.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Oct 2015 10:56:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804191#M3837</guid>
      <dc:creator>PaulLohr</dc:creator>
      <dc:date>2015-10-31T10:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: get field value returns 1</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804192#M3838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Paul - if you have a bug number those are often accessible to anyone with right-to-call. Incident numbers, we can only see the ones from our own organization.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 05:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804192#M3838</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2016-04-13T05:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: get field value returns 1</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804193#M3839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul, I have a cute little method I use with the Calculate Value tool that is much more flexible than that tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use it, choose a function below for the code block, and then use an expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;get_first(r"%table%")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Like GetFieldValue
def get_first(tbl, fld):
&amp;nbsp; return next(arcpy.da.SearchCursor(tbl, fid))[0]
# Get max
def get_max(tbl, fld):
&amp;nbsp; return sorted(arcpy.da.SearchCursor(tbl, fid))[0][0]
# Get min
def get_min(tbl, fld):
&amp;nbsp; return sorted(arcpy.da.SearchCursor(tbl, fid), reverse=True)[0][0]&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, if you have that bug number, please add it to this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:21:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/get-field-value-returns-1/m-p/804193#M3839</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T09:21:13Z</dc:date>
    </item>
  </channel>
</rss>

