<?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 Re: ArcGIS Pro 3.0.4 - Arcade 'if' statment syntax with variable? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1290143#M69278</link>
    <description>&lt;P&gt;Fantastic! Good to know array values has to be casted to text for 'if' statments... Very useful.&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2023 15:37:53 GMT</pubDate>
    <dc:creator>VincentLaunstorfer</dc:creator>
    <dc:date>2023-05-17T15:37:53Z</dc:date>
    <item>
      <title>ArcGIS Pro 3.0.4 - Arcade 'if' statment syntax with variable?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1289531#M69212</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In an Arcade statment, I am losing patience on silly syntax in an 'if' statment, with condition to compare the first 3 digits of postal code with a variable stored in an array, as below:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if (Left(city.postal_code,3) == myArray[f]) {&lt;/LI-CODE&gt;&lt;P&gt;The 'if' statment is simply ignored!&lt;/P&gt;&lt;P&gt;But if I hard-code a value, that's works fine:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if (Left(city.postal_code,3) == '332') {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any guess where the problem is?&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 11:26:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1289531#M69212</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2023-05-16T11:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.4 - Arcade 'if' statment syntax with variable?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1289537#M69213</link>
      <description>&lt;P&gt;Seems like myArray[f] is not equal to "332"...&lt;/P&gt;&lt;P&gt;That's all we can tell you from that snippet. If you want more detailed help, you'll have to post the whole expression.&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 11:36:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1289537#M69213</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-16T11:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.4 - Arcade 'if' statment syntax with variable?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1289556#M69215</link>
      <description>&lt;P&gt;For your code to work, the value of myArray[f] must be a string. If it's a number, it won't work. You have to use this syntax if it's a number&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (Left(city.postal_code,3) == Text(myArray[f])) {&lt;/LI-CODE&gt;&lt;P&gt;Here's a demo of that in the playground&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="playground.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70794iDEBB1E6D1A8617BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="playground.png" alt="playground.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 13:12:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1289556#M69215</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-05-16T13:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.4 - Arcade 'if' statment syntax with variable?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1290143#M69278</link>
      <description>&lt;P&gt;Fantastic! Good to know array values has to be casted to text for 'if' statments... Very useful.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 15:37:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1290143#M69278</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2023-05-17T15:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro 3.0.4 - Arcade 'if' statment syntax with variable?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1290145#M69279</link>
      <description>&lt;P&gt;You have to cast the value array to Text since "Left(city.postal_code,3)" is also a Text.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 15:42:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-3-0-4-arcade-if-statment-syntax-with/m-p/1290145#M69279</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-05-17T15:42:02Z</dc:date>
    </item>
  </channel>
</rss>

