<?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: Parameter value for Calculate Field Management? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152692#M11765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, 10.1 Which other post?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Sep 2013 20:52:41 GMT</pubDate>
    <dc:creator>ionarawilson1</dc:creator>
    <dc:date>2013-09-30T20:52:41Z</dc:date>
    <item>
      <title>Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152686#M11759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anybody tell me how I can grab the value of the second parameter (value) to use in my Calculate Field Management process? Right now is just adding %value% to the table instead of the value I enter as a parameter. Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Import arcpy module import arcpy&amp;nbsp; # Script arguments Selecting_Features = arcpy.GetParameterAsText(0) if Selecting_Features == '#' or not Selecting_Features: &amp;nbsp;&amp;nbsp;&amp;nbsp; Selecting_Features = "in_memory\\{1CFDCCDD-5D8D-42F8-AEB2-E66ED4A51A44}" # provide a default value if unspecified&amp;nbsp; value = arcpy.GetParameterAsText(1)&amp;nbsp; # Local variables: Input_Points = "D:\\ArcGISData\\ESRI_GEO_EX\\GDB.gdb\\SamplePoints" Final_Output = value&amp;nbsp; Input_Points_Layer = "SamplePoints_Layer"&amp;nbsp; # Process: Make Feature Layer arcpy.MakeFeatureLayer_management(Input_Points, Input_Points_Layer, "", "", "OBJECTID OBJECTID VISIBLE NONE;SymbologyField SymbologyField VISIBLE NONE;DomainField DomainField VISIBLE NONE;Shape Shape VISIBLE NONE;Subtype Subtype VISIBLE NONE;EditField EditField VISIBLE NONE")&amp;nbsp; # Process: Select Layer By Location arcpy.SelectLayerByLocation_management(Input_Points_Layer, "INTERSECT", Selecting_Features, "", "NEW_SELECTION") Selected_Features = Input_Points_Layer # Process: Calculate Field arcpy.CalculateField_management(Selected_Features, "EditField", "'%value%'", "PYTHON_9.3", "")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 20:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152686#M11759</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-09-30T20:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152687#M11760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Am I wrong, or have you already gotten 'value' with your line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;value = arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you print 'value' to see it the Get retrieved anything?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If it is good, ie the variable is populated with what you expect, then I think you can pass it into CalculateField directly as:&amp;nbsp; value&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 20:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152687#M11760</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-09-30T20:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152688#M11761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, value gets retrieved (in this case, Austin), but I still get an error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Mon Sep 30 16:31:56 2013&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Running script CalcFeatures...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TEST&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Austin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "D:\ArcGISData\ESRI_GEO_EX\calcfeatures_script.py", line 39, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(Selected_Features, "EditField", value, "PYTHON_9.3", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3129, in CalculateField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 000539: Error running expression: Austin &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;expression&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NameError: name 'Austin' is not defined&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalcFeatures).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed at Mon Sep 30 16:31:56 2013 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 20:32:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152688#M11761</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-09-30T20:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152689#M11762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is this related to your other post about the model where basically you want to code a field based on a Select By Location execution?&amp;nbsp; That value in the model is defined as an input parameter, meaning it is defined by you at runtime...(or, possibly, fetching the output from another tool as input in this tool).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just a suggestion, but looks like you could also do a spatial join, but looks like you want to define the value yourself as (in the example run) 'Austin', is that right?&amp;nbsp; Well, if you are running this as a script tool, you need to set from the script interface in toolbox the input parameter...then when the interface pops up, you enter the desired val, and it gets passed during runtime as the variable 'value'... that's what GetParameterAsText means, getting what was provided during the run, if that makes sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does that help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 20:41:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152689#M11762</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-09-30T20:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152690#M11763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Wayne, The parameter is already set in the toolbox interface. Yes, I need to have a parameter for the user to enter that value. I don't know if the problem is because I am trying to calculate a field in a layer. I tried using an updateCursor and it worked but it would be nice to know why it does not work with the calculate field function. Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# calcfeatures_script.py
# Created on: 2013-09-30 15:22:46.00000
#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)
# Usage: calcfeatures_script &amp;lt;Selecting_Features&amp;gt; &amp;lt;value&amp;gt; 
# Description: 
# test
# ---------------------------------------------------------------------------

# Import arcpy module
import os, sys, arcpy, traceback, arcgisscripting

# Script arguments
Selecting_Features = arcpy.GetParameterAsText(0)
value = arcpy.GetParameterAsText(1)
arcpy.AddMessage("TEST")
arcpy.AddMessage(value)


if Selecting_Features == '#' or not Selecting_Features:
&amp;nbsp;&amp;nbsp;&amp;nbsp; Selecting_Features = "in_memory\\{1CFDCCDD-5D8D-42F8-AEB2-E66ED4A51A44}" # provide a default value if unspecified



# Local variables:
Input_Points = "D:\\ArcGISData\\ESRI_GEO_EX\\GDB.gdb\\SamplePoints"
#Final_Output = value

Input_Points_Layer = "SamplePoints_Layer"

# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(Input_Points, Input_Points_Layer, "", "", "OBJECTID OBJECTID VISIBLE NONE;SymbologyField SymbologyField VISIBLE NONE;DomainField DomainField VISIBLE NONE;Shape Shape VISIBLE NONE;Subtype Subtype VISIBLE NONE;EditField EditField VISIBLE NONE")

# Process: Select Layer By Location
arcpy.SelectLayerByLocation_management(Input_Points_Layer, "INTERSECT", Selecting_Features, "", "NEW_SELECTION")
Selected_Features = Input_Points_Layer
# Process: Calculate Field



with arcpy.da.UpdateCursor(Selected_Features, ("EditField")) as rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # row comes back as a tuple in the order specified here, so Office is row[0], Forester is row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = value
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:11:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152690#M11763</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2021-12-11T08:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152691#M11764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh, right, your clue is here (below) - doesn't know what 'Austin' is....in other words, your CalculateField syntax is the problem - hold on and I will review the webhelp.&amp;nbsp; You are at 10.1 ?&amp;nbsp; Actually thanos hit on it at your other post...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 000539: Error running expression: Austin &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "&amp;lt;expression&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NameError: name 'Austin' is not defined&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 20:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152691#M11764</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-09-30T20:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152692#M11765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, 10.1 Which other post?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 20:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152692#M11765</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-09-30T20:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152693#M11766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;...VB is the default, so minimally you need the in_table, fieldName, and expression --- did you say you tried something like this below?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management (Selected_Features, "EditField", cstr(value))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure but is the expression param is the problem, it doesn't understand the value being passed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And your Python equivalent would essentially be (sorry I think 'cstr' above is the proper conversion to string, if not already string - and as reflected below, the Python conv to string is simply 'str):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management(Selected_Features, "EditField", str(value), "PYTHON_9.3")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 21:00:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152693#M11766</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-09-30T21:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152694#M11767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think Tim simplified things very nicely for you at your other post:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/93688-Model-converted-to-Script-Why-Can-t-it-find-the-field"&gt;http://forums.arcgis.com/threads/93688-Model-converted-to-Script-Why-Can-t-it-find-the-field&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, with your use of % I think you were trying to use what is called 'in-line variable substitution', not applicable here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Sep 2013 21:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152694#M11767</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-09-30T21:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152695#M11768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Wayne. When I tried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management(Selected_Features, "EditField", str(value), "PYTHON_9.3") &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "D:\ArcGISData\ESRI_GEO_EX\calcfeatures_script.py", line 32, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(Selected_Features, "EditField", str(value), "PYTHON_9.3")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3129, in CalculateField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 000539: Error running expression: Austin &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;expression&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NameError: name 'Austin' is not defined&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalcFeatures).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 14:46:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152695#M11768</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-01T14:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152696#M11769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;...oh, sorry, I don't usually use the Calculate Field tool but opt for using cursor...so the hint was the expression wasn't valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to test this but I think it's looking for this (below) as the expression, I'm not sure but worth a try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;arcpy.CalculateField_management(Selected_Features, "EditField", '"' + value + '"', "PYTHON_9.3") &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if that works...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 15:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152696#M11769</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-10-01T15:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152697#M11770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes!!! Thank you again! This is awesome! It was driving me crazy for two days!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 15:45:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152697#M11770</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-01T15:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152698#M11771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, well, this is just an additional note -- maybe it'll interest you and maybe not, but I think it could be instrumental for you to check out some of the samples from the webhelp pertaining to the expression parameter and further, the code block parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IMHO it is a confusing way to write 'code' but certainly interesting (if not somewhat bewildering) to have this option which I am quoting an excerpt of from the webhelp link I'll also include below (notice how the quoting was used):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Set local variables
inTable = "parcels"
fieldName = "areaclass"
expression = "getClass(float(!SHAPE.area!))"
codeblock = """def getClass(area):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if area &amp;lt;= 1000:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; if area &amp;gt; 1000 and area &amp;lt;= 10000:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 2
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 3"""
 
# Execute CalculateField 
arcpy.CalculateField_management(inTable, fieldName, expression, "PYTHON_9.3", codeblock)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Calculate Field (Data Management) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Desktop » Geoprocessing » Tool reference » Data Management toolbox&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004m000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000004m000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...for what it's worth!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:11:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152698#M11771</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T08:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter value for Calculate Field Management?</title>
      <link>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152699#M11772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very interesting indeed. Thank you for the link and the explanation. It is very helpful! Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 16:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/parameter-value-for-calculate-field-management/m-p/152699#M11772</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-01T16:20:13Z</dc:date>
    </item>
  </channel>
</rss>

