<?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 use arcade to auto populate from layer field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1334821#M73666</link>
    <description>&lt;P&gt;ArcGIS Pro 3.1&lt;/P&gt;&lt;P&gt;I want to auto populate from feature layer field "TDA_ID" to related table "assesment" with the same field "TDA_ID" and "repair_report" and also with the same field&amp;nbsp;"TDA_ID".&lt;/P&gt;&lt;P&gt;I use this expression but did not work.&lt;/P&gt;&lt;P&gt;var originFeatureSet = FeatureSetByName($datastore, "TrafficDamageAssessment", ["TDA_ID"], true);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Check if the current feature's TDA_ID is valid&lt;/P&gt;&lt;P&gt;if (IsEmpty($feature.TDA_ID)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return null;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var whereClause = "TDA_ID = '" + $feature.TDA_ID + "'"; // Assuming TDA_ID is a string. If it's numeric, remove the single quotes.&lt;/P&gt;&lt;P&gt;var relatedFeature = First(Filter(originFeatureSet, whereClause));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (!IsEmpty(relatedFeature)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return relatedFeature.TDA_ID;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return null;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2023 01:54:52 GMT</pubDate>
    <dc:creator>MiltonVrolijk</dc:creator>
    <dc:date>2023-10-04T01:54:52Z</dc:date>
    <item>
      <title>use arcade to auto populate from layer field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1334821#M73666</link>
      <description>&lt;P&gt;ArcGIS Pro 3.1&lt;/P&gt;&lt;P&gt;I want to auto populate from feature layer field "TDA_ID" to related table "assesment" with the same field "TDA_ID" and "repair_report" and also with the same field&amp;nbsp;"TDA_ID".&lt;/P&gt;&lt;P&gt;I use this expression but did not work.&lt;/P&gt;&lt;P&gt;var originFeatureSet = FeatureSetByName($datastore, "TrafficDamageAssessment", ["TDA_ID"], true);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Check if the current feature's TDA_ID is valid&lt;/P&gt;&lt;P&gt;if (IsEmpty($feature.TDA_ID)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return null;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var whereClause = "TDA_ID = '" + $feature.TDA_ID + "'"; // Assuming TDA_ID is a string. If it's numeric, remove the single quotes.&lt;/P&gt;&lt;P&gt;var relatedFeature = First(Filter(originFeatureSet, whereClause));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (!IsEmpty(relatedFeature)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return relatedFeature.TDA_ID;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return null;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 01:54:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1334821#M73666</guid>
      <dc:creator>MiltonVrolijk</dc:creator>
      <dc:date>2023-10-04T01:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: use arcade to auto populate from layer field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1334926#M73681</link>
      <description>&lt;P&gt;If you have a relate set up for the two tables, you can use the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationshipname" target="_self"&gt;FeatureSetByRelationshipName&lt;/A&gt; function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var relatedFS = FeatureSetByRelationshipName($feature, 'relate name');
return First(relatedFS).TDA_ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If they don't have a relationship, a note about constructing the sqlExpression for the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;Filter&lt;/A&gt;. You can make use of the Arcade variable substitution so you don't have to worry whether a value needs quotes or not&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var tdaid = $feature.TDA_ID;
var relatedFeature = First(Filter(originFeatureSet, "TDA_ID = @tdaid"));&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>Wed, 04 Oct 2023 14:16:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1334926#M73681</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-10-04T14:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: use arcade to auto populate from layer field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1337028#M73913</link>
      <description>&lt;P&gt;Also, take a look at a &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/lessons-learned-attribute-rules/m-p/1333467#M73561" target="_self"&gt;thread&lt;/A&gt;. JonnesLidner's response to my question about the exact same thing was super detailed and helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 17:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1337028#M73913</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2023-10-11T17:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: use arcade to auto populate from layer field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1337335#M73942</link>
      <description>&lt;P&gt;Thanks for the heads up&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 16:02:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1337335#M73942</guid>
      <dc:creator>MiltonVrolijk</dc:creator>
      <dc:date>2023-10-12T16:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: use arcade to auto populate from layer field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1337336#M73943</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 16:03:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/use-arcade-to-auto-populate-from-layer-field/m-p/1337336#M73943</guid>
      <dc:creator>MiltonVrolijk</dc:creator>
      <dc:date>2023-10-12T16:03:24Z</dc:date>
    </item>
  </channel>
</rss>

