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!
Try:
r<SPAN class="string token">"url=https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/{}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>!FACILITYID!<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Thank you both for your help! I used this in the field =
'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 <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/"</SPAN> f <SPAN class="operator token">=</SPAN> <SPAN class="string token">"{}{}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>r<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"00133"</SPAN><SPAN class="punctuation token">)</SPAN> f <SPAN class="string token">'https://s3.console.aws.amazon.com/s3/buckets/hamptondes/Manhole/00133'</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
if it is something else, the link is no good, copy the code here if possible.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.