<?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 How to use model builder to apply an attribute rule to feature classes when table name is in the expression? in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/how-to-use-model-builder-to-apply-an-attribute/m-p/1222160#M601</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to apply an attribute rule to multiple feature classes using iterate feature classes in model builder. I get an error message because expression has a table name that's different to the name of the feature classes I'm trying to add the rule to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ERROR 002717:&lt;/U&gt;&lt;/STRONG&gt;&lt;FONT color="#DE2900"&gt; Invalid Arcade expression, Arcade error: Table not found Table_4546, Script line: 2, SCRIPTEXPRESSION (row 2) [Table_4546]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Is there any in line substitution I can do to make it work?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2022 13:06:44 GMT</pubDate>
    <dc:creator>V1212</dc:creator>
    <dc:date>2022-10-17T13:06:44Z</dc:date>
    <item>
      <title>How to use model builder to apply an attribute rule to feature classes when table name is in the expression?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-use-model-builder-to-apply-an-attribute/m-p/1222160#M601</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to apply an attribute rule to multiple feature classes using iterate feature classes in model builder. I get an error message because expression has a table name that's different to the name of the feature classes I'm trying to add the rule to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ERROR 002717:&lt;/U&gt;&lt;/STRONG&gt;&lt;FONT color="#DE2900"&gt; Invalid Arcade expression, Arcade error: Table not found Table_4546, Script line: 2, SCRIPTEXPRESSION (row 2) [Table_4546]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Is there any in line substitution I can do to make it work?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 13:06:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-use-model-builder-to-apply-an-attribute/m-p/1222160#M601</guid>
      <dc:creator>V1212</dc:creator>
      <dc:date>2022-10-17T13:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use model builder to apply an attribute rule to feature classes when table name is in the expression?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-use-model-builder-to-apply-an-attribute/m-p/1222403#M604</link>
      <description>&lt;UL&gt;&lt;LI&gt;Get your Table name as variable (put "%" around the name in ModelBuilder)&lt;/LI&gt;&lt;LI&gt;Use Calculate Value&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;# Expression
generate_arcade_expression(%TableName%)

# Code Block
def generate_arcade_expression(table_name):
    return f"""
        var fs = FeaturesetByName($datastore, "{table_name}")
        var fs_intersect = Intersectcs(fs, $feature)
        //...
    """&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;Use the output of Calculate Value as Arcade Expression for Add Attribute Rule.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 17 Oct 2022 08:07:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-use-model-builder-to-apply-an-attribute/m-p/1222403#M604</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-10-17T08:07:08Z</dc:date>
    </item>
  </channel>
</rss>

