I have an Excel sheet enter it to model builder as a parameter and at next steps i need to create an expression for the fields inside the table and add the results to another field. The problem is the fields not exist to select for expression at field calculator.
So is there any way to solve this problem and how could i write ^ inside expression. I have Arc GIS 10.5.
I still new in python programming so,I tried to see some python code from the available codes but it give me an error Invalid field..
I wish to know what is the problem inside the code
Table name: #it will be parameter
Fields at table need to enter at expression: Geco, Par, kela (All numbers i consider all as float)
The new field for the results is MM
The code i tried with is:
Geco = arcpy.GetParameterAsFloat()
Par = arcpy.GetParameterAsFloat()
kela = arcpy.GetParameterAsFloat()
Geco_new = '!'+Geco+'!'
Par_new = '!'+Par+'!'
kela_new = '!'+kela+'!'
arcpy.CalculateField_management(outputfc, percentfield, '('+Geco_new+'*(2/'+Par_new+')^'+kela_new+'))', "PYTHON") So, please need your help and i appreciate that
Your python IDE should have raised a number of errors
You report any and all error messages when trying to get help with code samples.
Hi,
First Parameter should be Table and For second parameter, You can use Obtain From Parameter property as Excel Sheet. Please review attached snapshot for details.