<?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: Auto populate related table with parent feature attributes in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540665#M61592</link>
    <description>&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;I am no expert, but this is what I came up with.. let me know if this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Get the related feature from qPCR_Sites&lt;BR /&gt;var parentFeature = FeatureSetByRelationshipName($feature, "qPCR_Sites", ["Analyze_for"], true);&lt;/P&gt;&lt;P&gt;// Check if there is a related feature&lt;BR /&gt;if (Count(parentFeature) &amp;gt; 0) {&lt;BR /&gt;// Return the "Analyze_for" value from the related qPCR_Sites feature&lt;BR /&gt;var site = First(parentFeature);&lt;BR /&gt;return site["Analyze_for"];&lt;BR /&gt;} else {&lt;BR /&gt;// If no related feature is found, return null or an empty value&lt;BR /&gt;return null;&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 21:04:01 GMT</pubDate>
    <dc:creator>CooperCarlisle</dc:creator>
    <dc:date>2024-09-19T21:04:01Z</dc:date>
    <item>
      <title>Auto populate related table with parent feature attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540655#M61590</link>
      <description>&lt;P&gt;If you could help me with this I would be extremely appreciative!&lt;/P&gt;&lt;P&gt;I am working in Field Maps&lt;/P&gt;&lt;P&gt;Field staff will make multiple trips to sample sites throughout the year. Each time they stop at a sample site they will need to collect data to a table that has been related to a parent feature.&lt;/P&gt;&lt;P&gt;The parent feature is a point layer called "qPCR_Sites"&lt;/P&gt;&lt;P&gt;The related table is called "qPCR_Samples"&lt;/P&gt;&lt;P&gt;The parent feature has 14 different attributes that should be auto-populated to each collected record. These will not need to be edited and can be hidden.&lt;/P&gt;&lt;P&gt;Field staff will fill out 5 additional fields in the table during each sample session. ( I have this part handled)&lt;/P&gt;&lt;P&gt;I am trying to figure out the expression needed to auto-populate the 14 different attributes from "qPCR_Sites" to "qPCR_Samples".&lt;/P&gt;&lt;P&gt;The first attribute I am trying to tackle is the field "Analyze_for" It is stored as "Analyze_for" in both the "qPCR_Sites" attribute table and the related "qPCR_Samples" table.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Aaron&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with the appropriate expression?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 20:56:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540655#M61590</guid>
      <dc:creator>WFCAdmin</dc:creator>
      <dc:date>2024-09-19T20:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Auto populate related table with parent feature attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540665#M61592</link>
      <description>&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;I am no expert, but this is what I came up with.. let me know if this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Get the related feature from qPCR_Sites&lt;BR /&gt;var parentFeature = FeatureSetByRelationshipName($feature, "qPCR_Sites", ["Analyze_for"], true);&lt;/P&gt;&lt;P&gt;// Check if there is a related feature&lt;BR /&gt;if (Count(parentFeature) &amp;gt; 0) {&lt;BR /&gt;// Return the "Analyze_for" value from the related qPCR_Sites feature&lt;BR /&gt;var site = First(parentFeature);&lt;BR /&gt;return site["Analyze_for"];&lt;BR /&gt;} else {&lt;BR /&gt;// If no related feature is found, return null or an empty value&lt;BR /&gt;return null;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 21:04:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540665#M61592</guid>
      <dc:creator>CooperCarlisle</dc:creator>
      <dc:date>2024-09-19T21:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Auto populate related table with parent feature attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540703#M61594</link>
      <description>&lt;P&gt;Thank you so much for looking into this!&lt;/P&gt;&lt;P&gt;Unfortunately, I am getting&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Test execution error: Execution error - Invalid parameter. Verify test data."&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 23:09:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540703#M61594</guid>
      <dc:creator>WFCAdmin</dc:creator>
      <dc:date>2024-09-19T23:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Auto populate related table with parent feature attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540705#M61595</link>
      <description>&lt;P&gt;Thank you so much!!!&lt;/P&gt;&lt;P&gt;With your help I was able to get to the following formula which is working for me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;parentFeature&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;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:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1540705#M61595</guid>
      <dc:creator>WFCAdmin</dc:creator>
      <dc:date>2024-09-19T23:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Auto populate related table with parent feature attributes</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1558214#M62345</link>
      <description>&lt;P&gt;You might also consider setting up Domain rules for the fields of interest in ArcGIS Pro, and providing default values. Those values should auto-populate when submitting new records. If you don't want to republish the whole thing though, this is an interesting approach. Glad to hear it's working out!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 18:52:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/auto-populate-related-table-with-parent-feature/m-p/1558214#M62345</guid>
      <dc:creator>aaron_tob</dc:creator>
      <dc:date>2024-11-13T18:52:59Z</dc:date>
    </item>
  </channel>
</rss>

