I'm trying to label address points (with the ArcGIS Online labeling functionality) for one of our city's webmaps. Some of the addresses have unit numbers, some don't. I put together an Arcade expression that checks the "unit" field for values so that all points will be labeled correctly.
<SPAN class="keyword token">var</SPAN> unitVal <SPAN class="operator token">=</SPAN> $feature<SPAN class="punctuation token">.</SPAN>unit
<SPAN class="keyword token">var</SPAN> stVal <SPAN class="operator token">=</SPAN> $feature<SPAN class="punctuation token">.</SPAN>snumber
<SPAN class="keyword token">function</SPAN> <SPAN class="token function">mainfunc</SPAN><SPAN class="punctuation token">(</SPAN>unitVal<SPAN class="punctuation token">,</SPAN>stVal<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>unitVal <SPAN class="operator token">==</SPAN> <SPAN class="string token">' '</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> stVal
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> <SPAN class="token function">Concatenate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>stVal<SPAN class="punctuation token">,</SPAN>unitVal<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">':'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="token function">mainfunc</SPAN><SPAN class="punctuation token">(</SPAN>unitVal<SPAN class="punctuation token">,</SPAN>stVal<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The labels appear correctly in ArcGIS Online, but will not draw in a web application that calls on that AGO map. Has anyone come across the same issue?
