<?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: Calculate Field from related table in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1539659#M88353</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;very slick way of solving my problem. Thank you for sharing!&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 19:03:16 GMT</pubDate>
    <dc:creator>NourSalamJMT</dc:creator>
    <dc:date>2024-09-17T19:03:16Z</dc:date>
    <item>
      <title>Calculate Field from related table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259123#M65639</link>
      <description>&lt;P&gt;I have a table of points from field observations and a related table holding the pictures for each point. I need to rename the photos after the ID of the point. I would like to take the value from the ID field of the points and use it to replace the attachment name, then concatenate a ".jpg" and the end of the string. Is there an Arcade Expression that does this?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 21:28:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259123#M65639</guid>
      <dc:creator>janderson_ksninc</dc:creator>
      <dc:date>2023-02-16T21:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field from related table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259167#M65643</link>
      <description>&lt;P&gt;Not sure of a way in Arcade, but very doable in python.&lt;/P&gt;&lt;P&gt;I use this on feature class with attachments enabled to update the attachment name to the id of the point (My attachments are all jpegs).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

inFeatureClass = r'Database Connections\dbname.sde\dbname.DBO.Points'         # feature class with attachments
pointFieldsList = ['GlobalID','ID']                                           # fields to load into cursor

inTable = r'Database Connections\dbname.sde\dbname.DBO.Points__ATTACH'        #  attachment table for feature class
tableFieldsList = ['REL_GLOBALID', 'DATA', 'ATT_NAME', 'ATTACHMENTID']        # field list in attachment table   


global_dict = {}

with arcpy.da.SearchCursor(inFeatureClass, pointFieldsList) as point_cursor:  # cursor to make dict of globalID's
        for row in point_cursor:
          if row[1]:
            row1 = row[1]                                 # I'm using "ID" as my name field, but is
          else:                                           # not always populated.  if Null, substitute "NA"
            row1 = "NA"
          global_dict[row[0]] = row1                      # add to dict with globallID as key, name as value



with arcpy.da.UpdateCursor(inTable, tableFieldsList) as cursor:

    for row in cursor:
        if row[0] in global_dict:
            row[2] = global_dict[row[0]] + '.jpg'
            cursor.updateRow(row)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 23:28:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259167#M65643</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2023-02-16T23:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field from related table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259239#M65650</link>
      <description>&lt;P&gt;For the Calculate Field tool with Arcade:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var related = First(FeaturesetByRelationshipName($feature, "TestPoints__ATTACHREL"))
if(related == null) { return $feature.ATT_NAME }
return related.OBJECTID + ".jpg"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1676619213668.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63074i547EB0C5633040C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1676619213668.png" alt="JohannesLindner_0-1676619213668.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1676619409289.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/63076i5F5C293727CDF7E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_1-1676619409289.png" alt="JohannesLindner_1-1676619409289.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 07:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259239#M65650</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-02-17T07:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field from related table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259586#M65694</link>
      <description>&lt;P&gt;Thanks for responding! Would you happen to know how to do this in an Arcade Expression for an indicator in Dashboards?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 22:33:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259586#M65694</guid>
      <dc:creator>janderson_ksninc</dc:creator>
      <dc:date>2023-02-17T22:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field from related table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259634#M65699</link>
      <description>&lt;P&gt;What do you want to show in the indicator?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 10:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1259634#M65699</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-02-18T10:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field from related table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1539659#M88353</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;very slick way of solving my problem. Thank you for sharing!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 19:03:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1539659#M88353</guid>
      <dc:creator>NourSalamJMT</dc:creator>
      <dc:date>2024-09-17T19:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field from related table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1603993#M94769</link>
      <description>&lt;P&gt;I know I'm resurrecting an old post, but whenever I use FeatureSetByRelationshipName I get an "Invalid Relationship name" error. I know the name of the relationship is corrected and the relted worked correctly because I can see the data in the pop up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you happen to have any insight on how to fix this?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 21:19:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculate-field-from-related-table/m-p/1603993#M94769</guid>
      <dc:creator>TarkingtonGeospatial</dc:creator>
      <dc:date>2025-04-08T21:19:46Z</dc:date>
    </item>
  </channel>
</rss>

