hello7

field calculator python expression with parameters

Discussion created by hello7 on Mar 10, 2013
Latest reply on Mar 11, 2013 by LDanzinger-esristaff
Hi, I am trying to concatonate an existing field with a parameter in a python script

parameter = 4
expression = !field! + ", " + parameter
arcpy.management.CalculateField("testshp", "field", expression, "PYTHON")

my field is a text field with a value of "1, 2, 3" and i want to make it "1, 2, 3, 4" where everytime the script runs and the user inputs
a number it adds a comma, a space, then the parameter. I keep running into issues with combining a string and an int but the parameter is preset to string. Any ideas? Thanks.

Outcomes