<?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 get feature attribute (error 002717,  unexpecter null,invalide error) arcade in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/get-feature-attribute-error-002717-unexpecter-null/m-p/1209020#M59430</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;i am having somme trouble getting the feature attribute when i use this syntaxe: feature.attribute&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;// get the feature with the highest id
var s = FeatureSetByName($datastore,"patrimoine",['*'],false);
var k= $feature.code_pat2
var p = filter( s,'code_pat2 = @k')
var max_feature = First(OrderBy(p, "code_avis DESC"))
// get the number of that id

return max_feature.code_avis&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"code_avis" is an attribute in the feature "max_feature"&lt;/P&gt;&lt;P&gt;in the expression builder of arcade in arcgis pro the syntax is valide&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="solidsnake_0-1662097139841.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50229i16AA293557E39295/image-size/medium?v=v2&amp;amp;px=400" role="button" title="solidsnake_0-1662097139841.png" alt="solidsnake_0-1662097139841.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but when i want to save the attribute rules i get this message&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="solidsnake_1-1662097229583.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50230iA144DCC14CB30EB7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="solidsnake_1-1662097229583.png" alt="solidsnake_1-1662097229583.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;note that isempty (max_feature) = false&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;texte (max_feature) =&amp;nbsp;{"geometry":null,"attributes":{"code_avis":"PAT0010-03","code_pat":"PAT0009","code_pat2":"PAT0010","GlobalID":"{9FAFFFA1-4E28-4733-B498-EE8FA3BD9E8E}","numero":null,"OBJECTID":54,"obs":"6545"}}&lt;/P&gt;&lt;P&gt;that mean it is not an empty feature and the value i should get as return is "PAT0010-03"&lt;/P&gt;&lt;P&gt;how can i solve this problème&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2022 05:48:01 GMT</pubDate>
    <dc:creator>solidsnake</dc:creator>
    <dc:date>2022-09-02T05:48:01Z</dc:date>
    <item>
      <title>get feature attribute (error 002717,  unexpecter null,invalide error) arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-feature-attribute-error-002717-unexpecter-null/m-p/1209020#M59430</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;i am having somme trouble getting the feature attribute when i use this syntaxe: feature.attribute&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;// get the feature with the highest id
var s = FeatureSetByName($datastore,"patrimoine",['*'],false);
var k= $feature.code_pat2
var p = filter( s,'code_pat2 = @k')
var max_feature = First(OrderBy(p, "code_avis DESC"))
// get the number of that id

return max_feature.code_avis&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"code_avis" is an attribute in the feature "max_feature"&lt;/P&gt;&lt;P&gt;in the expression builder of arcade in arcgis pro the syntax is valide&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="solidsnake_0-1662097139841.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50229i16AA293557E39295/image-size/medium?v=v2&amp;amp;px=400" role="button" title="solidsnake_0-1662097139841.png" alt="solidsnake_0-1662097139841.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but when i want to save the attribute rules i get this message&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="solidsnake_1-1662097229583.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50230iA144DCC14CB30EB7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="solidsnake_1-1662097229583.png" alt="solidsnake_1-1662097229583.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;note that isempty (max_feature) = false&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;texte (max_feature) =&amp;nbsp;{"geometry":null,"attributes":{"code_avis":"PAT0010-03","code_pat":"PAT0009","code_pat2":"PAT0010","GlobalID":"{9FAFFFA1-4E28-4733-B498-EE8FA3BD9E8E}","numero":null,"OBJECTID":54,"obs":"6545"}}&lt;/P&gt;&lt;P&gt;that mean it is not an empty feature and the value i should get as return is "PAT0010-03"&lt;/P&gt;&lt;P&gt;how can i solve this problème&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 05:48:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-feature-attribute-error-002717-unexpecter-null/m-p/1209020#M59430</guid>
      <dc:creator>solidsnake</dc:creator>
      <dc:date>2022-09-02T05:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: get feature attribute (error 002717,  unexpecter null,invalide error) arcade</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/get-feature-attribute-error-002717-unexpecter-null/m-p/1209029#M59432</link>
      <description>&lt;P&gt;I'm surprised that this expression is shown as valid. Normally, this error should be shown in the validation.&lt;/P&gt;&lt;P&gt;The normal way to solve that error is to check if the feature returned with First() is null (meaning an empty feature set) and returning a default value if so.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var max_feature = First(OrderBy(p, "code_avis DESC"))
if(max_feature == null) {
    return null
}
return max_feature.code_avis&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Sep 2022 06:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/get-feature-attribute-error-002717-unexpecter-null/m-p/1209029#M59432</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-09-02T06:07:35Z</dc:date>
    </item>
  </channel>
</rss>

