I am trying to add a hyperlink to a layer referencing another field in the layer. I'm using python3 expression type in the calculate field window. Below is the code:
'https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/!FACILITYID!'
However, It is populating with:
https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/u"00133"
For some reason it is adding the u and the " " around my facility ID
I need it to simply be:
https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/00133
Any help is greatly appreciated!
Solved! Go to Solution.
Try:
r"url=https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/{}".format(!FACILITYID!)
If you need a string returned, then you need to concatenate the inputs as strings
r = r"https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/"
f = "{}{}".format(r, "00133")
f
'https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/00133'
if it is something else, the link is no good, copy the code here if possible.
Try:
r"url=https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/{}".format(!FACILITYID!)
Thank you both for your help! I used this in the field =
'https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/{}'.format(!FACILITYID!)