<?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 Creating custom key with attribute rules in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310389#M71290</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have just started my first experiments with attribute rules.&lt;BR /&gt;In my organization, for house numbers, we have an attribute key for each feature, which is composed of the attributes "STRSCHL" and "HAUSNR". These are separated by an underscore. Using the attribute rules, I have managed with the following expression that this key is automatically generated and automatically adjusts when changes are made in the attributes "STRSCHL" or "HAUSNR".&lt;/P&gt;&lt;P&gt;$feature.STRSCHL+'_'+$feature.HAUSNR&lt;/P&gt;&lt;P&gt;However, there are other elements in the feature class that should not receive this key. In these, however, the underscore is always present. Using the following expression, I have now tried that the key is only assigned to features that contain the value "33100" in the attribute "OS_2".&lt;/P&gt;&lt;P&gt;If (Includes([$feature.OS_2],33100)) {&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;$feature.STRSCHL+'_'+$feature.HAUSNR&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Now in the expression builder I do not get an error message about a syntax error. However, the key is not generated in practice, unlike the code above. Do I still have an error in my input or do I have to use another function?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jul 2023 08:42:03 GMT</pubDate>
    <dc:creator>PatrickLösel</dc:creator>
    <dc:date>2023-07-21T08:42:03Z</dc:date>
    <item>
      <title>Creating custom key with attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310389#M71290</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have just started my first experiments with attribute rules.&lt;BR /&gt;In my organization, for house numbers, we have an attribute key for each feature, which is composed of the attributes "STRSCHL" and "HAUSNR". These are separated by an underscore. Using the attribute rules, I have managed with the following expression that this key is automatically generated and automatically adjusts when changes are made in the attributes "STRSCHL" or "HAUSNR".&lt;/P&gt;&lt;P&gt;$feature.STRSCHL+'_'+$feature.HAUSNR&lt;/P&gt;&lt;P&gt;However, there are other elements in the feature class that should not receive this key. In these, however, the underscore is always present. Using the following expression, I have now tried that the key is only assigned to features that contain the value "33100" in the attribute "OS_2".&lt;/P&gt;&lt;P&gt;If (Includes([$feature.OS_2],33100)) {&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;$feature.STRSCHL+'_'+$feature.HAUSNR&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Now in the expression builder I do not get an error message about a syntax error. However, the key is not generated in practice, unlike the code above. Do I still have an error in my input or do I have to use another function?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 08:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310389#M71290</guid>
      <dc:creator>PatrickLösel</dc:creator>
      <dc:date>2023-07-21T08:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom key with attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310476#M71300</link>
      <description>&lt;P&gt;You mixed up the arguments of &lt;A href="https://developers.arcgis.com/arcade/function-reference/array_functions/#includes" target="_blank" rel="noopener"&gt;Includes().&lt;/A&gt; First comes the array, then the element you search for.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// array of OS_2 values for which you want to return the key
var os2_values = [33100, ]

// if the OS_2 value of the current $feature is included in that array, construct the key
if (Includes(os2_values, $feature.OS_2]) {
    return $feature.STRSCHL+'_'+$feature.HAUSNR
}
// else just return what's in the field
return $feature.Key&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 21 Jul 2023 14:05:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310476#M71300</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-07-21T14:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom key with attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310877#M71343</link>
      <description>&lt;P&gt;Hello Johannes,&lt;/P&gt;&lt;P&gt;thanks for the fast respond! I now tried the following expression, but it still didn't work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-07-24 08_12_33-Ausdruck-Generator.png" style="width: 392px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/76063i2072BBF41A361BE6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-07-24 08_12_33-Ausdruck-Generator.png" alt="2023-07-24 08_12_33-Ausdruck-Generator.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 06:13:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310877#M71343</guid>
      <dc:creator>PatrickLösel</dc:creator>
      <dc:date>2023-07-24T06:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom key with attribute rules</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310933#M71346</link>
      <description>&lt;P&gt;The second argument of Includes() has to be a single value, you're trying to input an array.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/array_functions/#includes" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/array_functions/#includes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 10:48:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/creating-custom-key-with-attribute-rules/m-p/1310933#M71346</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-07-24T10:48:55Z</dc:date>
    </item>
  </channel>
</rss>

