<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Remove spaces from labels when using expressions in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/remove-spaces-from-labels-when-using-expressions/m-p/1682674#M101703</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to label some features with data from various columns in the attribute table. I've been using VBScript to do this, with an expression such as:&lt;/P&gt;&lt;P&gt;[Column 1] &amp;amp;vbnewline&amp;amp; [Column 2] &amp;amp;vbnewline&amp;amp; [Column 3] &amp;amp;vbnewline&amp;amp; etc.&lt;/P&gt;&lt;P&gt;The problem I'm encountering is if one of the columns is empty or has a null value, the label skips a line where that columns label should be (see screenshot).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JamesCarroll7_0-1770377655505.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148036i1AB90715BF4643A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JamesCarroll7_0-1770377655505.png" alt="JamesCarroll7_0-1770377655505.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to remove this space? This is my first time using expressions to display labels in this way, so I'm relatively unfamiliar with VPScript, Arcade etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Feb 2026 11:36:11 GMT</pubDate>
    <dc:creator>JamesCarroll7</dc:creator>
    <dc:date>2026-02-06T11:36:11Z</dc:date>
    <item>
      <title>Remove spaces from labels when using expressions</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-spaces-from-labels-when-using-expressions/m-p/1682674#M101703</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to label some features with data from various columns in the attribute table. I've been using VBScript to do this, with an expression such as:&lt;/P&gt;&lt;P&gt;[Column 1] &amp;amp;vbnewline&amp;amp; [Column 2] &amp;amp;vbnewline&amp;amp; [Column 3] &amp;amp;vbnewline&amp;amp; etc.&lt;/P&gt;&lt;P&gt;The problem I'm encountering is if one of the columns is empty or has a null value, the label skips a line where that columns label should be (see screenshot).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JamesCarroll7_0-1770377655505.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148036i1AB90715BF4643A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JamesCarroll7_0-1770377655505.png" alt="JamesCarroll7_0-1770377655505.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to remove this space? This is my first time using expressions to display labels in this way, so I'm relatively unfamiliar with VPScript, Arcade etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 11:36:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-spaces-from-labels-when-using-expressions/m-p/1682674#M101703</guid>
      <dc:creator>JamesCarroll7</dc:creator>
      <dc:date>2026-02-06T11:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Remove spaces from labels when using expressions</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-spaces-from-labels-when-using-expressions/m-p/1682707#M101707</link>
      <description>&lt;P&gt;In Arcade, you can check whether a field is empty before adding it to the string.&lt;/P&gt;&lt;P&gt;This example uses an array (fields) that contains the field name of each of your fields (line 2). The code loops through that array (line 4) and adds the value to an array (output) if the field's value is not empty (line 5). It uses the &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#concatenate" target="_self"&gt;Concatenate&lt;/A&gt; function to return a string with all of the non-empty values in the output array on a separate line (line 7)&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var output = [];
var fields = ["fieldName1", "fieldName2", "fieldName3"];

for (var field of fields) {
  if (!IsEmpty($feature[field])) Push(output,$feature[field]);
}
return Concatenate(output, TextFormatting.NewLine);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2026 13:57:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-spaces-from-labels-when-using-expressions/m-p/1682707#M101707</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2026-02-06T13:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Remove spaces from labels when using expressions</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/remove-spaces-from-labels-when-using-expressions/m-p/1682993#M101733</link>
      <description>&lt;P&gt;Thanks for your response, I'll try that expression out this morning!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2026 08:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/remove-spaces-from-labels-when-using-expressions/m-p/1682993#M101733</guid>
      <dc:creator>JamesCarroll7</dc:creator>
      <dc:date>2026-02-09T08:44:33Z</dc:date>
    </item>
  </channel>
</rss>

