<?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: Constraint Rule, Arcade, Lookup table value in dictionary in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/constraint-rule-arcade-lookup-table-value-in/m-p/1297751#M953</link>
    <description>&lt;P&gt;Does it work if you insert this after line 9?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// check if the DataOwner is included in the dictionary
if(!HasKey(partners, featureDataOwner)) return false&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 09 Jun 2023 21:04:41 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-06-09T21:04:41Z</dc:date>
    <item>
      <title>Constraint Rule, Arcade, Lookup table value in dictionary</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/constraint-rule-arcade-lookup-table-value-in/m-p/1297734#M952</link>
      <description>&lt;P&gt;I'm having issues creating a Constraint rule that checks whether a value exists within an array. These arrays will define whether or not the features can be edited by the user if they have a matching group/key to the owner field in the table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that when passing the owner value from the feature class table, to the object, to grab the correct array&amp;nbsp; of users, the attribute rule will not save and errors out saying that it cannot find the field. However, it will pass debugging using Console() within the Arcade editor window.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will also work if the owner value is hard coded to grab the correct array (i.e. var array1 = partners['partner2'];). But will not work when that value is passed in a variable.&lt;/P&gt;&lt;P&gt;Has anyone else seen any issues around these topics setting up attribute rules?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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 partners = Dictionary(
    'partner1', ["user1", "user2"], 
    'partner2', ["user5", "user4"])

// Get currently logged in user
var userInfo = getUser().username;

// Get the "partner" value of the currently edited feature
var featureDataOwner = Replace($feature.DataOwner, ' ', ''); //theres sometimes spaces in the feature class table
var array1 = partners[featureDataOwner];

Console(userInfo)
Console(featureDataOwner)
Console(array1)

if (Includes(array1, userInfo)) return true

return false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 20:06:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/constraint-rule-arcade-lookup-table-value-in/m-p/1297734#M952</guid>
      <dc:creator>ebcdm</dc:creator>
      <dc:date>2023-06-09T20:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Constraint Rule, Arcade, Lookup table value in dictionary</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/constraint-rule-arcade-lookup-table-value-in/m-p/1297751#M953</link>
      <description>&lt;P&gt;Does it work if you insert this after line 9?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// check if the DataOwner is included in the dictionary
if(!HasKey(partners, featureDataOwner)) return false&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 21:04:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/constraint-rule-arcade-lookup-table-value-in/m-p/1297751#M953</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-06-09T21:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Constraint Rule, Arcade, Lookup table value in dictionary</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/constraint-rule-arcade-lookup-table-value-in/m-p/1297760#M954</link>
      <description>&lt;P&gt;It appears that it is working with that. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 21:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/constraint-rule-arcade-lookup-table-value-in/m-p/1297760#M954</guid>
      <dc:creator>ebcdm</dc:creator>
      <dc:date>2023-06-09T21:35:27Z</dc:date>
    </item>
  </channel>
</rss>

