Field Calculate Hyperlinks Referencing Another Field

2341
7
Jump to solution
06-12-2020 05:22 AM
JoeLivoti
New Contributor III

Hi all!

I was wondering how to go about adding a hyperlink en masse to an attribute table. It would seem straight forward, but I am running into an issue.
The scenario is thus: I am trying to add a hyperlink that references another field. 

www.company.com/generalinfo.aspx?ParcelID=field i need to reference here

I've tried it with ' ' and with ! ! around the field. I went to this page FAQ: Is it possible to add a hyperlink path to a field in ArcGIS Pro? and tried using this in the field calculator to no avail. I keep getting a syntax error. Any help would be greatly appreciated. Thank you!

0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

You are building your string expression incorrectly, try:

'http://www2.alleghenycounty.us/RealEstate/GeneralInfo.aspx?ParcelID={}'.format(!LOWPARCELID!)

View solution in original post

7 Replies
DavidPike
MVP Frequent Contributor

can you screenshot the input and error on field calculator? are you using the python interpreter when using !  !

0 Kudos
JoeLivoti
New Contributor III

I am trying to get this to work similarly to 

However, I think they created that link within the webmap configure popup box on arc online. If i could do that en masse I would within the arc online environment, but I cannot fathom how that would be done. Hence the calculate field and just make it a part of the record.

0 Kudos
DavidPike
MVP Frequent Contributor

encase it all in double quotes as your single quotes will have confused 'lowparcelid' in the string

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

You are building your string expression incorrectly, try:

'http://www2.alleghenycounty.us/RealEstate/GeneralInfo.aspx?ParcelID={}'.format(!LOWPARCELID!)
JoeLivoti
New Contributor III

should the whole thing be in single or double quotes?

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

No.  You should read up on building string expressions using Python's string.format():  string — Common string operations — Python 3.8.3 documentation 

0 Kudos
JoeLivoti
New Contributor III

Thank you so much Joshua Bixby! that did the trick exactly!!!

0 Kudos