<?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: In need of help with Arcade expressions in Spatial Data Science Questions</title>
    <link>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552431#M1241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you trying to add attributes to a pop-up based on an intersection?&amp;nbsp; If you are, have you seen the following document:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-in-pop-ups-quick-introduction-to-using-featuresets-with-arcade"&gt;https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-in-pop-ups-quick-introduction-to-using-featuresets-with-arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Nov 2019 14:26:05 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2019-11-15T14:26:05Z</dc:date>
    <item>
      <title>In need of help with Arcade expressions</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552430#M1240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two features in my map. A polygon feature and a point feature. I would like to join the polygon feature to the point feature using a common field. All the points are contained within the polygons. I have about 2000 points and 100's of polygons. I have tried using the Arcade expression below to calculate the join field in my point features to populate it with the unique identifier of the polygon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="box-sizing: border-box; font-family: 'Segoe UI', 'Helvetica Neue', 'Apple Color Emoji', 'Segoe UI Emoji', Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;var intersectLayer =Within(FeatureSetByName($datastore, "Polygon"),Geometry($feature))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;var address = ""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;var cnt = 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;for (var f in intersectLayer){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cnt == 0){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; address = f.oaddr2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {address = "No Address Found"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: Calibri; "&gt;return address&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still very inexperienced with coding, so I apologize if my question is not entirely clear.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2019 13:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552430#M1240</guid>
      <dc:creator>AdamMajzoub</dc:creator>
      <dc:date>2019-11-15T13:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: In need of help with Arcade expressions</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552431#M1241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you trying to add attributes to a pop-up based on an intersection?&amp;nbsp; If you are, have you seen the following document:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-in-pop-ups-quick-introduction-to-using-featuresets-with-arcade"&gt;https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-in-pop-ups-quick-introduction-to-using-featuresets-with-arcade&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2019 14:26:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552431#M1241</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2019-11-15T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: In need of help with Arcade expressions</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552432#M1242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this. This is useful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2019 13:14:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552432#M1242</guid>
      <dc:creator>AdamMajzoub</dc:creator>
      <dc:date>2019-12-02T13:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: In need of help with Arcade expressions</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552433#M1243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/366235" target="_blank"&gt;Adam Majzoub&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple of things wrong with the expression. First of all you cannot provide a FeatureSet to&amp;nbsp;the Within function. It requires geometries. If you only want to have a single address, you don't need to loop through the results. See the example below:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; intersectLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Intersects&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$datastore&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Polygon"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; address &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intersectLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    address &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"No Address Found"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    address &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;intersectLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;oaddr2&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; address&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:52:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/in-need-of-help-with-arcade-expressions/m-p/552433#M1243</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T23:52:57Z</dc:date>
    </item>
  </channel>
</rss>

