I need to generate a unique id using field calculator in ArcMap. I am a student and I am having problems finding the script or getting auto increment to work or anything else.
You'll need to create a quick python script to auto increment through values. In the field calculator, set the
Show Codeblock. In your
Pre-Logic Script Code block, use:
def UID (): global i try: i += 1 except: i = 1 try: return i except: return str(i)
Then in your field calculator, just type:
If you need to start over, click the Python window button on the
Standard toolbar, and type