I am trying to concatenate a domain URL followed by a field name using Calculate Field tool. In the Expression field in the Calculate Field window, the sql expression looks like:
PHOTO_URL =
<a href=DomainURL/FolderName/&" "&!PHOTO!>Photo</a>
However, in the attribute table, the PHOTO_URL's values are populated as
<a href=''DomainURL/FolderName/PhotoName.jpg''''>Photo</a>
I get an extra " at the end of the href. When opening the map service using the arcgis online, when the PHOTO_URL atttribute is clicked, it reloads the current web URL instead of redirecting to the photo url.
Any help or suggestions are greatly appreciated.
Thanks
Solved! Go to Solution.
python syntax
PHOTO = 'somephoto.jpg'
'DomainURL/FolderName/{}'.format(PHOTO) # syntax line
yields
'DomainURL/FolderName/somephoto.jpg'
Field calculator syntax
'DomainURL/FolderName/{}'.format(!PHOTO!) # syntax line
just put exclamation marks around PHOTO in the syntax line above so that it reads ... !PHOTO!
Saroj,
Can you share one record from your data so that I can test the issue?
~Shan
Thanks for your response, Shantonu. The issue is resolved now.
python syntax
PHOTO = 'somephoto.jpg'
'DomainURL/FolderName/{}'.format(PHOTO) # syntax line
yields
'DomainURL/FolderName/somephoto.jpg'
Field calculator syntax
'DomainURL/FolderName/{}'.format(!PHOTO!) # syntax line
just put exclamation marks around PHOTO in the syntax line above so that it reads ... !PHOTO!