AnsweredAssumed Answered

arcpy calculate field expression

Question asked by OLK0831901 on Mar 13, 2018
Latest reply on Mar 13, 2018 by Dan_Patterson

I am trying to create a file path and add it to a field by concatenating the path with a file name that is held in a field in my data.My path is a constant \Links\Sheets\Project\ and my Drawing_Name field has values like Drawing01.pdf, Drawing02.pdf etc. 


I keep getting the error:


The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. Failed to execute (CalculateField).


The function is written like this...

# Process: Calculate Field
arcpy.CalculateField_management(Centroids, "URL", expression, "PYTHON_9.3", "")

 And for my expression I want something like one of these...

expression = "\"\\\\Links\\\\Sheets\\\\Project\\\\\"+ !Drawing_Name!"

expression = "\"\\Links\\Sheets\\Project\\{0}\".format( !Drawing_Name! )"

I want to end up with \Links\Sheets\Project\Drawing01.pdf in the field.


The first expression used to work, but seems to throw the error above now - I believe it is my punctuation which is the problem - can anyone help?