<?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: Arcade IF statement Returns False result in ArcGIS-Pro Pop-up in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-statement-returns-false-result-in-arcgis/m-p/1545802#M88918</link>
    <description>&lt;P&gt;This return statement will not give you the information you desire. The &lt;A href="https://developers.arcgis.com/arcade/guide/operators/#logical-operators" target="_self"&gt;logical operator&lt;/A&gt; (&amp;amp;&amp;amp;) in the return can only return a true or false. In the if statement, you're checking whether the OBJECTID of the feature is 299. Since that is true, the conditions ($feature.OBJECTID==297) in the return will both be false.&lt;/P&gt;&lt;P&gt;You also cannot use the logical operator with a statement that doesn't return a "True" or "False" (I'm assuming $feature.USER_C_UNI_VLAN_ID is the "VLAN ID" in your table).&lt;/P&gt;&lt;P&gt;If I'm understanding what you're trying to do, you should add in two additional Arcade field elements to your popup for the other two records. The code would look something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var feat = First(Filter($layer, "OBJECTID = 297"));
return {
  type: "fields",
  title: `Record ${feat.OBJECTID}`,
  fieldInfos: [
    { fieldName: "Service Type" },
    { fieldName: "Service Medium" },
    { fieldName: "VLAND ID" }
  ],
  attributes:
    {
      "Service Type": feat["Service_Type"],
      "Service Medium": feat["Service_Medium"],
      "VLAND ID": feat["USER_C_UNI_VLAN_ID"]
    }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Oct 2024 20:20:37 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-10-04T20:20:37Z</dc:date>
    <item>
      <title>Arcade IF statement Returns False result in ArcGIS-Pro Pop-up</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-statement-returns-false-result-in-arcgis/m-p/1545757#M88916</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;When a point feature with Object ID 299 is selected, two other records from the same attribute table should be retrieved and displayed in a pop-up as a secondary table on the same Pop-up. (ArcGIS Pro). I am employing the if statement Arcade Expression, but it returns false.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;The following is a screenshot of the code and embedding of the expression into HTML for display in the pop-up. This is the code I am using.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any tips?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if($feature.OBJECTID==299){&lt;BR /&gt;return $feature.OBJECTID==297 &amp;amp;&amp;amp; $feature.OBJECTID==300&amp;nbsp;&amp;amp;&amp;amp; $feature.USER_C_UNI_VLAN_ID&lt;BR /&gt;}&lt;/DIV&gt;</description>
      <pubDate>Fri, 04 Oct 2024 18:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-statement-returns-false-result-in-arcgis/m-p/1545757#M88916</guid>
      <dc:creator>nKuhan</dc:creator>
      <dc:date>2024-10-04T18:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade IF statement Returns False result in ArcGIS-Pro Pop-up</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-statement-returns-false-result-in-arcgis/m-p/1545782#M88917</link>
      <description>&lt;P&gt;I wish it were that easy! To retrieve the attributes of other features, you'll need to use some other functions.&lt;/P&gt;&lt;P&gt;In your expression, calling "$feature.OBJECTID" is going to return the object ID of the current feature.&lt;/P&gt;&lt;P&gt;The expression "$feature.OBJECTID==297" is what's called a "truthy" statement, in that it can be answered "true" or "false". If the clicked feature had the object ID of 297, that will return "true".&lt;/P&gt;&lt;P&gt;So, since you're chaining together multiple such statements with an "&amp;amp;&amp;amp;", Arcade is evaluating the statements as one large boolean. Since a given feature can only have a single object ID, asking it to return the output of "$feature.OBJECTID==297 &amp;amp;&amp;amp; $feature.OBJECTID==300" will &lt;STRONG&gt;always&lt;/STRONG&gt; be false, because you can't have one of those true without the other being false.&lt;/P&gt;&lt;P&gt;Take a look at the FeatureSetByName and Filter functions. You can use those to selectively return specific features and then access their individual attributes.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 19:33:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-statement-returns-false-result-in-arcgis/m-p/1545782#M88917</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-10-04T19:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade IF statement Returns False result in ArcGIS-Pro Pop-up</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-statement-returns-false-result-in-arcgis/m-p/1545802#M88918</link>
      <description>&lt;P&gt;This return statement will not give you the information you desire. The &lt;A href="https://developers.arcgis.com/arcade/guide/operators/#logical-operators" target="_self"&gt;logical operator&lt;/A&gt; (&amp;amp;&amp;amp;) in the return can only return a true or false. In the if statement, you're checking whether the OBJECTID of the feature is 299. Since that is true, the conditions ($feature.OBJECTID==297) in the return will both be false.&lt;/P&gt;&lt;P&gt;You also cannot use the logical operator with a statement that doesn't return a "True" or "False" (I'm assuming $feature.USER_C_UNI_VLAN_ID is the "VLAN ID" in your table).&lt;/P&gt;&lt;P&gt;If I'm understanding what you're trying to do, you should add in two additional Arcade field elements to your popup for the other two records. The code would look something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var feat = First(Filter($layer, "OBJECTID = 297"));
return {
  type: "fields",
  title: `Record ${feat.OBJECTID}`,
  fieldInfos: [
    { fieldName: "Service Type" },
    { fieldName: "Service Medium" },
    { fieldName: "VLAND ID" }
  ],
  attributes:
    {
      "Service Type": feat["Service_Type"],
      "Service Medium": feat["Service_Medium"],
      "VLAND ID": feat["USER_C_UNI_VLAN_ID"]
    }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 20:20:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-if-statement-returns-false-result-in-arcgis/m-p/1545802#M88918</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-04T20:20:37Z</dc:date>
    </item>
  </channel>
</rss>

