<?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: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1384607#M57572</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/338797"&gt;@JohnEvans6&lt;/a&gt;&amp;nbsp;, thank you for the feedback.&amp;nbsp; I've been working thru what you provided, but am still having trouble/receiving errors, although I think it is likely due to me not replicating correctly.&lt;/P&gt;&lt;P&gt;If/when you have time, I have a few questions.&amp;nbsp; Below is the code I have written based on the feedback/example you provided - **I realized instead of my fields in both layers called LatLong, they are titled "XYjoin":&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Build SQL to query against Pole Layer. XYjoin is Pole layer coordinates field; feature.XYjoin is the cable's coordinate field&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleXY&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Pole"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'XYjoin'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleID&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Pole"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'ID'&lt;/SPAN&gt;&lt;SPAN&gt;]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"PoleXY = "&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;XYjoin&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;// Filter your pole layer get to only return features where the coordinate fields are equal between Cable and Pole&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Pole"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'XYjoin'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'ID'&lt;/SPAN&gt;&lt;SPAN&gt;]), &lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;// If return is not empty. get the first feature and build your return text&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (!&lt;/SPAN&gt;&lt;SPAN&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt;)) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleID&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;First&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;'text'&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;text&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;`This cables Start/End Pole is: &lt;/SPAN&gt;&lt;SPAN&gt;${&lt;/SPAN&gt;&lt;SPAN&gt;PoleID&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;`&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Appreciate any additional insight you could offer.&amp;nbsp; Thank you!&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 20 Feb 2024 20:54:15 GMT</pubDate>
    <dc:creator>Mowgli_GIS</dc:creator>
    <dc:date>2024-02-20T20:54:15Z</dc:date>
    <item>
      <title>Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1383831#M57541</link>
      <description>&lt;P&gt;Hello, I'm trying to extract data from a layer's field and insert into another layer's field based on attributes matching each other from both features, but I'm struggling to create the correct script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My scenario is I have a Utility Pole layer and Cable layer, wherein I have a field in both layers for the combined lat/long coordinates, and as I create new features in the Cable Layer I need to provide both the Start Pole ID and End Pole ID on which the cable is attached (Start ID and End ID are fields in Cable Layer, and Pole Layer has an ID field). So my thought, if possible, is to create an Arcade script in the Cable Start/End ID fields that will look at the Pole layer's Lat/Long coordinate field for a feature with the matching coordinates to the Cable's feature, and if there is a match then extract that Pole Feature's ID and insert in either the corresponding Start or End ID field of the Cable feature.&amp;nbsp; Below is what I have, code is being written within the Start ID and/or End ID fields of the Cable layer feature, however it does not work:&lt;/P&gt;&lt;DIV&gt;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nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Appreciate any help and insight anyone could offer!&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 18 Feb 2024 00:01:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1383831#M57541</guid>
      <dc:creator>Mowgli_GIS</dc:creator>
      <dc:date>2024-02-18T00:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1383858#M57542</link>
      <description>&lt;P&gt;Adding to/Updating my original post - below is script I've come up with that seems to get me almost there, but not quite - this code block is being written in the "PoleID" field of the Cable layer:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleFeature&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Pole"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'LatLong'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleID&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&l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t;/DIV&gt;OBJECTID ID &lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN class=""&gt;"Pole-1"&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;And within the actual field it returns&amp;nbsp;[object Object]&lt;/P&gt;&lt;P&gt;I need the Cable's PoleID field for the specific feature to return the "&lt;SPAN class=""&gt;Pole-1" attribute value.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 18 Feb 2024 14:40:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1383858#M57542</guid>
      <dc:creator>Mowgli_GIS</dc:creator>
      <dc:date>2024-02-18T14:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1384035#M57548</link>
      <description>&lt;P&gt;Sorry I don't have time to check if this actually works, but I think you want something that looks like this. If it doesn't work it hopefully gets you close to a solution.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Build SQL to query against Pole Layer. LatLong is in the pole field. feature.LatLong is the cable's LatLong field
var sql = Concatenate("LatLong = ", $feature.LatLong)

// Filter your pole layer get to only return features where the LatLong fields are equal between Cable and Pole
var features = Filter(FeatureSetByName($map, "Pole", ['LatLong','PoleID']), sql)

// If return is not empty. get the first feature and build your return text
if (!IsEmpty(features)) {
  var pole_data = First(features)
  return { 
	  type : 'text', 
	  text : `This cables Start/End Pole is: ${pole_data.PoleID}`
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 14:54:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1384035#M57548</guid>
      <dc:creator>JohnEvans6</dc:creator>
      <dc:date>2024-02-19T14:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1384607#M57572</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/338797"&gt;@JohnEvans6&lt;/a&gt;&amp;nbsp;, thank you for the feedback.&amp;nbsp; I've been working thru what you provided, but am still having trouble/receiving errors, although I think it is likely due to me not replicating correctly.&lt;/P&gt;&lt;P&gt;If/when you have time, I have a few questions.&amp;nbsp; Below is the code I have written based on the feedback/example you provided - **I realized instead of my fields in both layers called LatLong, they are titled "XYjoin":&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Build SQL to query against Pole Layer. XYjoin is Pole layer coordinates field; feature.XYjoin is the cable's coordinate field&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleXY&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Pole"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'XYjoin'&lt;/SPAN&gt;&lt;SPAN&gt;])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleID&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Pole"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'ID'&lt;/SPAN&gt;&lt;SPAN&gt;]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Concatenate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"PoleXY = "&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;XYjoin&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;// Filter your pole layer get to only return features where the coordinate fields are equal between Cable and Pole&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Pole"&lt;/SPAN&gt;&lt;SPAN&gt;, [&lt;/SPAN&gt;&lt;SPAN&gt;'XYjoin'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'ID'&lt;/SPAN&gt;&lt;SPAN&gt;]), &lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;// If return is not empty. get the first feature and build your return text&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (!&lt;/SPAN&gt;&lt;SPAN&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt;)) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;PoleID&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;First&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; { &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;'text'&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;text&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;`This cables Start/End Pole is: &lt;/SPAN&gt;&lt;SPAN&gt;${&lt;/SPAN&gt;&lt;SPAN&gt;PoleID&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;`&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Appreciate any additional insight you could offer.&amp;nbsp; Thank you!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Feb 2024 20:54:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1384607#M57572</guid>
      <dc:creator>Mowgli_GIS</dc:creator>
      <dc:date>2024-02-20T20:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1384851#M57595</link>
      <description>&lt;P&gt;Knowing me I overcomplicated it. What about something simpler like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var pole_features = FeatureSetByName($map, "Pole", ['XYjoin','PoleID'])

for (var f in pole_features) {
  If (f.XYjoin == $feature.XYjoin) {
      return { 
           type : 'text', 
           text : `Pole ID is : ${f.PoleID}`
      }
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 13:25:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1384851#M57595</guid>
      <dc:creator>JohnEvans6</dc:creator>
      <dc:date>2024-02-21T13:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385170#M57608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/338797"&gt;@JohnEvans6&lt;/a&gt;&amp;nbsp;, it’s me again, sorry…..&lt;/P&gt;&lt;P&gt;I keep getting errors and I have a tough time understanding the syntax fully.&amp;nbsp; I’m not sure what I have wrong.&amp;nbsp; I've tried a bunch of different iterations, but below is the current iteration that I have.&amp;nbsp; The portions marked with yellow I’m not fully following what they represent and where those pieces are being pulled from.&lt;/P&gt;&lt;P&gt;What does f.XYjoin represent on line 8?&lt;/P&gt;&lt;P&gt;What do lines 10 &amp;amp; 11 represent/where is f.PoleID pulled from/represent?&lt;/P&gt;&lt;P&gt;I also provided the screen shots of the Profile variables&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mowgli_GIS_0-1708552502680.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95417i3BDE56E8CDC4679D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mowgli_GIS_0-1708552502680.png" alt="Mowgli_GIS_0-1708552502680.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The string of code is being written within the pole_id field of the Riser Layer&lt;/P&gt;&lt;P&gt;Pole layer fields and info are being pulled from the $map feature service (see below)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mowgli_GIS_1-1708552502682.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95418i00E83BB8FC32B9C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mowgli_GIS_1-1708552502682.png" alt="Mowgli_GIS_1-1708552502682.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mowgli_GIS_2-1708552502682.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95419i6B2A7C5A29F156E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mowgli_GIS_2-1708552502682.png" alt="Mowgli_GIS_2-1708552502682.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The ID field marked below is the pole layer’s ID field from which I want to pull an attribute and insert into the pole_id field in the Riser layer based on the pole layer’s XYjoin field attribute matching the Riser layer’s XYjoin field attribute&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mowgli_GIS_3-1708552502683.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95420i9F707A916B91C24E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mowgli_GIS_3-1708552502683.png" alt="Mowgli_GIS_3-1708552502683.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Again, apologies for the repeated questions, and I appreciate if/when you’re able to provide any help &amp;amp; feedback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 22:01:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385170#M57608</guid>
      <dc:creator>Mowgli_GIS</dc:creator>
      <dc:date>2024-02-21T22:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385193#M57609</link>
      <description>&lt;P&gt;Get rid of your first 3 variables and just use PoleFeatures.&lt;/P&gt;&lt;P&gt;f is just variable that holds the data from each feature within PoleFeatres&lt;/P&gt;&lt;P&gt;${f.PoleID} should just be ${f.ID}, sorry. Hard to work with data I can't see.&lt;/P&gt;&lt;P&gt;If you put a Console(f) above the if statement, it will print out each feature within PoleFeatures as it iterates. You're sure the XYjoin field will match between the two data sets, yeah?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 23:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385193#M57609</guid>
      <dc:creator>JohnEvans6</dc:creator>
      <dc:date>2024-02-21T23:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385676#M57639</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/338797"&gt;@JohnEvans6&lt;/a&gt;&amp;nbsp;, I think we're close?&amp;nbsp; I adjusted based on your feedback and below is what came back:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mowgli_GIS_0-1708632536906.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95546i43103415B64265F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mowgli_GIS_0-1708632536906.png" alt="Mowgli_GIS_0-1708632536906.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I also confirmed that the XY values match in both layers for the specific features I used to test the code.&lt;/P&gt;&lt;P&gt;However, when I created the new Riser feature, below is what populated in the pole_id field for the Riser feature:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mowgli_GIS_1-1708632686179.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95547iADFF1C6FDA599E85/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mowgli_GIS_1-1708632686179.png" alt="Mowgli_GIS_1-1708632686179.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But what I want to populate is just the HSWG text, which is the pole feature's ID:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mowgli_GIS_2-1708632964751.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95549i9EC91B5CBD971718/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mowgli_GIS_2-1708632964751.png" alt="Mowgli_GIS_2-1708632964751.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry again for all the questions, and I appreciate all the feedback/help you've given!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 20:19:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385676#M57639</guid>
      <dc:creator>Mowgli_GIS</dc:creator>
      <dc:date>2024-02-22T20:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help creating Arcade Script to extract data from one layer's field to insert into another layer's field based on identical attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385684#M57641</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/338797"&gt;@JohnEvans6&lt;/a&gt;&amp;nbsp;, I guess I replied a bit too quick, I tried one more thing and it worked!&amp;nbsp; Below is the code:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt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;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; } &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;"test"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I wouldn't have been able to figure this out or even get close without your help.&amp;nbsp; So again, THANK YOU!!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Feb 2024 20:41:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/help-creating-arcade-script-to-extract-data-from/m-p/1385684#M57641</guid>
      <dc:creator>Mowgli_GIS</dc:creator>
      <dc:date>2024-02-22T20:41:36Z</dc:date>
    </item>
  </channel>
</rss>

