<?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: Getting additional Data from separate Table in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1339805#M74197</link>
    <description>&lt;P&gt;That allowed it to valid, however, now it is complaining about "&lt;EM&gt;Undefined keyword is used in the dictionary return script. [attributes]&lt;/EM&gt;" when I try to insert a new record.&amp;nbsp; I've checked my column names from the StreetCenterline feature class - they are all spelled correctly.&amp;nbsp; I did remove the 'minDistance:&amp;nbsp; dist' line as that is not in the feature class that I'm adding data to.&lt;/P&gt;&lt;P&gt;I have tested the base part of this script with just one column being filled in and it worked.&amp;nbsp; It seems to be the use of 'attributes: {list....} that is tripping me up.&amp;nbsp; I am using the same column names in both my address point and street centerline feature classes.&amp;nbsp; Would I be needing the "result" term in there at all?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lorinda&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 20:46:11 GMT</pubDate>
    <dc:creator>LorindaGilbert</dc:creator>
    <dc:date>2023-10-19T20:46:11Z</dc:date>
    <item>
      <title>Getting additional Data from separate Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1339733#M74186</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Think I'm just completely overlooking something here.&amp;nbsp; I'm attempting to get the closest street to a point for an address and gathering the individual components of the name for the address point.&lt;/P&gt;&lt;P&gt;Here's what I'm attempting to use for the code.&amp;nbsp; It was telling me that I needed another curly brace, checked them all, they all matched up.&amp;nbsp; Now it says that the else is a reserved word on the second else on line 37.&amp;nbsp; Any help is appreciated.&lt;/P&gt;&lt;P&gt;Lorinda&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fsn = $feature.FullStreetName;
var streetLayer = FeatureSetByName($datastore, "server.dbo.StreetCenterline");
var pre = $feature.PreDirection;
var sn = $feature.StreetName;
var st = $feature.StreetType;
var post = $feature.PostDirection;
var searchDistance = 150;
var streetIntersect = Intersects(streetLayer, Buffer($feature, searchDistance, "feet"));
var cnt = Count(streetIntersect);
var minDistance = Infinity;

if (cnt &amp;gt; 0) {
    for (var street in streetIntersect) {
        var dist = Distance(street, $feature, "feet");
        if (dist &amp;lt; minDistance) {
            var stparse = {
                attributes: {
                pre: ["streetLayer.PreDirection"],
                sn: ["streetLayer.StreetName"],
                st:  ["streetLayer.StreetType"],
                post: ["streetLayer.PostDirection"],
                fsn:  ["streetLayer.FullStreetName"],
                minDistance: dist
                }
            }
        } else {
            var stparse = {
                attributes: {
                pre: "",
                sn: "",
                st:  "",
                post: "",
                fsn:  ""
                }
            }
        }    
    } else {
    // pass no features found within search distance, name remains null
        var stparse = {
          attributes: {
            pre: "",
            sn: "",
            st:  "",
            post: "",
            fsn:  ""
          }
      }
    }
}

return stparse;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 18:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1339733#M74186</guid>
      <dc:creator>LorindaGilbert</dc:creator>
      <dc:date>2023-10-19T18:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Getting additional Data from separate Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1339741#M74188</link>
      <description>&lt;P&gt;You didn't close out the for loop before the else on line 37&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fsn = $feature.FullStreetName;
var streetLayer = FeatureSetByName($datastore, "server.dbo.StreetCenterline");
var pre = $feature.PreDirection;
var sn = $feature.StreetName;
var st = $feature.StreetType;
var post = $feature.PostDirection;
var searchDistance = 150;
var streetIntersect = Intersects(streetLayer, Buffer($feature, searchDistance, "feet"));
var cnt = Count(streetIntersect);
var minDistance = Infinity;

if (cnt &amp;gt; 0) {
  for (var street in streetIntersect) {
    var dist = Distance(street, $feature, "feet");
    if (dist &amp;lt; minDistance) {
      var stparse = {
        attributes: {
          pre: ["streetLayer.PreDirection"],
          sn: ["streetLayer.StreetName"],
          st:  ["streetLayer.StreetType"],
          post: ["streetLayer.PostDirection"],
          fsn:  ["streetLayer.FullStreetName"],
          minDistance: dist
        }
      }
    } else {
      var stparse = {
        attributes: {
          pre: "",
          sn: "",
          st:  "",
          post: "",
          fsn:  ""
        }
      }
    }    
  }
} else {
  // pass no features found within search distance, name remains null
  var stparse = {
    attributes: {
      pre: "",
      sn: "",
      st:  "",
      post: "",
      fsn:  ""
    }
  }
}

return stparse;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 19:10:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1339741#M74188</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-10-19T19:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Getting additional Data from separate Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1339805#M74197</link>
      <description>&lt;P&gt;That allowed it to valid, however, now it is complaining about "&lt;EM&gt;Undefined keyword is used in the dictionary return script. [attributes]&lt;/EM&gt;" when I try to insert a new record.&amp;nbsp; I've checked my column names from the StreetCenterline feature class - they are all spelled correctly.&amp;nbsp; I did remove the 'minDistance:&amp;nbsp; dist' line as that is not in the feature class that I'm adding data to.&lt;/P&gt;&lt;P&gt;I have tested the base part of this script with just one column being filled in and it worked.&amp;nbsp; It seems to be the use of 'attributes: {list....} that is tripping me up.&amp;nbsp; I am using the same column names in both my address point and street centerline feature classes.&amp;nbsp; Would I be needing the "result" term in there at all?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lorinda&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 20:46:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1339805#M74197</guid>
      <dc:creator>LorindaGilbert</dc:creator>
      <dc:date>2023-10-19T20:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Getting additional Data from separate Table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1340086#M74225</link>
      <description>&lt;P&gt;Sorry, I did not read that post correctly and typed too soon.&lt;/P&gt;&lt;P&gt;I recently had the same problem. Arcade doesn't super like nested dictionaries the way we would do them in Python.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var dDict ={}
var t = "red"
var s = "apple"
var u = "delicious"
dDict[t] = {s : u}
return dDict

//Yields : {"red": {s:"delicious"}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT this works instead.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var dDict ={}
var t = "red"
var s = "apple"
var u = "delicious"
dDict[t] = Dictionary(s, u)
return dDict

//Yields : {"red": {"apple":"delicious"}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try manually constructing the dictionary like that and see what you get.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 15:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/getting-additional-data-from-separate-table/m-p/1340086#M74225</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-10-20T15:54:13Z</dc:date>
    </item>
  </channel>
</rss>

