Python question to automate attribute information

3649
2
02-26-2015 09:30 AM
MarcosMendez
New Contributor III

Hello everyone, I have very little Python experience and
would like to know if the following repetitive task would be suitable to
automate through python… My task is to update attributes for utility lines and
one of the attributes is a field called DOCID which is the associated
engineering document number. In the past there was a hyperlink between the
DOCID number and the associated PDF version of the engineering drawing, so that
when staff needs to look up the drawing for a sewer line, they could just click
on the sewer line in the web application and get the associated engineering
drawing as a PDF. Since we are now using Silverlight (we used ArcIMS in the
past) we now have to have two fields for DOCID, one of the fields holds the
document ID number (DOCID field) which is a 9 digit identification number and
the other field is called DOC LINK which is the hyperlink to the drawing
followed by the DOCID number: http://websv01/idmws/ISAPILogon.asp?Library=ocsd^EDMS&ID=003894611

The last nine digits on the hyperlink is the DOCID number.
Is there a way through python to automatically fill in the hyperlink: http://websv01/idmws/ISAPILogon.asp?Library=ocsd^EDMS&ID=

And to automatically add in the 9 digit DOCID number towards
the end of the hyperlink as the DOCID field gets updated/populated with the ID
number? So if I’m entering let’s say 003894611 to the DOCID field, I would like
the DOC LINK field to automatically update with the hyperlink and the DOCID so
that it will look like this: http://websv01/idmws/ISAPILogon.asp?Library=ocsd^EDMS&ID=003894611

Attribute Table Example.jpg

Thanks,

Marcos Mendez

0 Kudos
2 Replies
DarrenWiens2
MVP Honored Contributor

Are you mostly stuck on how to automate this by row (could use the Field Calculator or python update cursor or python to call Calculate Field) or through multiple feature classes (same as repeating by row, but also using python to loop through feature classes)? Or are you asking how to automatically calculate the field by editing a different field?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Hi Marcos,

The easiest way to do this is using the Attribute Assistant.  Take a look at the following thread:

Automatically update a field in an edit session