jak zobrazím formát telefonního čísla (123) 456-7890<\/A><\/SPAN> v Web Map pop-up, který byl původně formátován jako číselný?<\/P><\/BODY><\/HTML>
A phone number can't be numeric, but text/string
"(123) 456-7890"
Hi Thomas,
You'll be able to achieve this by using Arcade in the pop up:
Help:
Text Functions | ArcGIS for Developers
Configure pop-ups—ArcGIS Online Help | ArcGIS
Carmel
Oh now I see what you want to do.
Field calculator in arcmap or Pro
add an integer field (long, short)
substitute 'a' for !YourFieldName! in line 3 below.
a <SPAN class="operator token">=</SPAN> <SPAN class="string token">"(123) 456-7890"</SPAN> int<SPAN class="punctuation token">(</SPAN><SPAN class="string token">""</SPAN><SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>i <SPAN class="keyword token">for</SPAN> i <SPAN class="keyword token">in</SPAN> a <SPAN class="keyword token">if</SPAN> i<SPAN class="punctuation token">.</SPAN>isdigit<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="number token">1234567890</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
You will have to use the Custom Attribute Display (as Carmel Connolly indicated), but the html content should be like this:
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>a</SPAN> <SPAN class="attr-name token">href</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>tel:5551234567<SPAN class="punctuation token">"</SPAN></SPAN><SPAN class="punctuation token">></SPAN></SPAN>Call (555)123-4567<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>a</SPAN><SPAN class="punctuation token">></SPAN></SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
... to make it clickable and to be able to make the call. You can use a single expression to make the display text and use the content of the field just after "tel:" is the field just contains the digits.
Oh cool!
Hi @XanderBakker ,
I have been trying to create an expression for this in Map Viewer Beta and I copied and pasted your example above but I keep getting this error: "Parse Error:Line 4: Unexpected token <"
Any thoughts or ideas?
Thanks, Bill~
Hi @BillHeigh ,
Can you share what data you have (data) and what you are trying? The example I posted should be changed in order to include the field with the phone number. It just represents what the resulting HTML should look like. Not sure if it will show up as a link in the Map Viewer Beta.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.