<?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: Keeping data when it exists, but filling in otherwise in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570295#M1654</link>
    <description>&lt;P&gt;That seems to have worked, my testers will let me know for sure though &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; .&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2024 18:15:39 GMT</pubDate>
    <dc:creator>LorindaGilbert</dc:creator>
    <dc:date>2024-12-19T18:15:39Z</dc:date>
    <item>
      <title>Keeping data when it exists, but filling in otherwise</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570199#M1651</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; I'm using a modified version of the Local Government Solution for Addressing.&amp;nbsp; I would like to utilize the nearest street Attribute Rule; however, we have times when we need to change the street name to another street - primarily on corners.&amp;nbsp; It works well to pull a street name and fill in the attributes; however, when we change it if needed, or if it is selecting the wrong street, we need to be able to change it and it stick.&amp;nbsp; I've removed the update portion of the AR and it still puts the name back to what it chose originally.&amp;nbsp; Any help on this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;var streetLayer = FeatureSetByName($datastore, "StreetCenterline");&lt;BR /&gt;var searchDistance = 150;&lt;BR /&gt;var streetIntersect = Intersects(streetLayer, Buffer($feature, searchDistance, "feet"));&lt;BR /&gt;var cnt = Count(streetIntersect);&lt;BR /&gt;var minDistance = Infinity;&lt;BR /&gt;var stname = null;&lt;/P&gt;&lt;P&gt;if (!(isempty($feature.FullStreetName))) {&lt;BR /&gt;stname = $feature.FullStreetName;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;else if ((cnt &amp;gt; 0) &amp;amp;&amp;amp; (isempty($feature.FullStreetName))) {&lt;BR /&gt;for (var street in streetIntersect) {&lt;BR /&gt;var dist = Distance(street, $feature, "feet");&lt;BR /&gt;if (dist &amp;lt; minDistance) {&lt;BR /&gt;stname = street.FullStreetName;&lt;BR /&gt;minDistance = dist&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;} else {&lt;BR /&gt;// pass no features found within search distance, name remains null&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return stname;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 15:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570199#M1651</guid>
      <dc:creator>LorindaGilbert</dc:creator>
      <dc:date>2024-12-19T15:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping data when it exists, but filling in otherwise</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570242#M1652</link>
      <description>&lt;P&gt;Attribute rules do not perform any updates if you return with no value, so if you throw this at the top:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (!IsEmpty($feature.FullStreetName)) {
    return  // Do not replace existing data
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the rest of your code can run below. As an added bonus, you've guaranteed "FullStreetName" is an empty value which can simplify your logic a bit.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 17:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570242#M1652</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2024-12-19T17:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping data when it exists, but filling in otherwise</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570288#M1653</link>
      <description>&lt;P&gt;&amp;nbsp;I copied your code and updated for street featureclass name and fields and seems to be working as expected.&amp;nbsp; Auto assigns the closest street name, but, If I change it in the attribute table (I have domain dropdown on this field), it will update to whatever street I select and stick.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RhettZufelt_1-1734630164417.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122144iFFE0E9999F59FD23/image-size/large?v=v2&amp;amp;px=999" role="button" title="RhettZufelt_1-1734630164417.png" alt="RhettZufelt_1-1734630164417.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Only thing I really see different is that my street field names are different in my lookup street centerline layer and the target layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Line 15 should have the field name containing the streetname in your&amp;nbsp;&lt;SPAN&gt;FeatureSetByName($datastore, "StreetCenterline") layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MAIN_ROAD = streetname field in target layer&lt;/P&gt;&lt;P&gt;Street_Lables_Zoom = streetname field in lookup layer&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 17:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570288#M1653</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-12-19T17:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping data when it exists, but filling in otherwise</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570295#M1654</link>
      <description>&lt;P&gt;That seems to have worked, my testers will let me know for sure though &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; .&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 18:15:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/keeping-data-when-it-exists-but-filling-in/m-p/1570295#M1654</guid>
      <dc:creator>LorindaGilbert</dc:creator>
      <dc:date>2024-12-19T18:15:39Z</dc:date>
    </item>
  </channel>
</rss>

