<?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 Arcade Expressions: Creating an expression for labels with multiple fields in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-expressions-creating-an-expression-for/m-p/1342650#M74539</link>
    <description>&lt;P&gt;I'm using ArcGIS Pro 3.1.3 and I will start out by saying I am a beginner with computer languages.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I am trying to write an expression for labels using Arcade.&amp;nbsp; I can get the Else If statements to be valid expressions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if ($feature.CTV == "C"){&lt;BR /&gt;return "City"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "V"){&lt;BR /&gt;return "Village"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "T"){&lt;BR /&gt;return "Township"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GrantCountyGISSup_0-1698415119623.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84272i1964E54660AEFABC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GrantCountyGISSup_0-1698415119623.png" alt="GrantCountyGISSup_0-1698415119623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, this is only one part of the Label. I need to add MCD_Name to the beginning to get an out put like Paris Township.&amp;nbsp; When I try to add it:&lt;/P&gt;&lt;P&gt;$feature.MCD_NAME + TextFormatting.NewLine +&lt;/P&gt;&lt;P&gt;if ($feature.CTV == "C"){&lt;BR /&gt;return "City"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "V"){&lt;BR /&gt;return "Village"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "T"){&lt;BR /&gt;return "Township"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I get an Error stating its an Invalid Expression. Error on line 3. Reserved keyword used.&lt;/P&gt;&lt;P&gt;I tried adding parenthesis, quotations, brackets etc.. (again I am no expert on computer language) and nothing seemed to work.&amp;nbsp; I looked at other examples and such but I could not seem to find this kind of scenario.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2023 14:05:37 GMT</pubDate>
    <dc:creator>GrantCountyGISSup</dc:creator>
    <dc:date>2023-10-27T14:05:37Z</dc:date>
    <item>
      <title>Arcade Expressions: Creating an expression for labels with multiple fields</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-expressions-creating-an-expression-for/m-p/1342650#M74539</link>
      <description>&lt;P&gt;I'm using ArcGIS Pro 3.1.3 and I will start out by saying I am a beginner with computer languages.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I am trying to write an expression for labels using Arcade.&amp;nbsp; I can get the Else If statements to be valid expressions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if ($feature.CTV == "C"){&lt;BR /&gt;return "City"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "V"){&lt;BR /&gt;return "Village"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "T"){&lt;BR /&gt;return "Township"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GrantCountyGISSup_0-1698415119623.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84272i1964E54660AEFABC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GrantCountyGISSup_0-1698415119623.png" alt="GrantCountyGISSup_0-1698415119623.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, this is only one part of the Label. I need to add MCD_Name to the beginning to get an out put like Paris Township.&amp;nbsp; When I try to add it:&lt;/P&gt;&lt;P&gt;$feature.MCD_NAME + TextFormatting.NewLine +&lt;/P&gt;&lt;P&gt;if ($feature.CTV == "C"){&lt;BR /&gt;return "City"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "V"){&lt;BR /&gt;return "Village"&lt;BR /&gt;}&lt;BR /&gt;else if ($feature.CTV == "T"){&lt;BR /&gt;return "Township"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I get an Error stating its an Invalid Expression. Error on line 3. Reserved keyword used.&lt;/P&gt;&lt;P&gt;I tried adding parenthesis, quotations, brackets etc.. (again I am no expert on computer language) and nothing seemed to work.&amp;nbsp; I looked at other examples and such but I could not seem to find this kind of scenario.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 14:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-expressions-creating-an-expression-for/m-p/1342650#M74539</guid>
      <dc:creator>GrantCountyGISSup</dc:creator>
      <dc:date>2023-10-27T14:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expressions: Creating an expression for labels with multiple fields</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-expressions-creating-an-expression-for/m-p/1342656#M74540</link>
      <description>&lt;P&gt;What you'll want to do is to create a variable that holds the first part of your label and use that to append the city type&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var output = $feature.MCD_NAME + TextFormatting.NewLine;

if ($feature.CTV == "C"){
  output += "City";
}
else if ($feature.CTV == "V"){
  output += "Village";
}
else if ($feature.CTV == "T"){
  output += "Township";
}

return output;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 14:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-expressions-creating-an-expression-for/m-p/1342656#M74540</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-10-27T14:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expressions: Creating an expression for labels with multiple fields</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-expressions-creating-an-expression-for/m-p/1342670#M74541</link>
      <description>&lt;P&gt;Awesome! I appreciate your input, it worked like a charm!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 14:39:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-expressions-creating-an-expression-for/m-p/1342670#M74541</guid>
      <dc:creator>GrantCountyGISSup</dc:creator>
      <dc:date>2023-10-27T14:39:05Z</dc:date>
    </item>
  </channel>
</rss>

