<?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 Code to make a field from one service/feature to show up in a pop-up of another service/feature that is in the same map? in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/code-to-make-a-field-from-one-service-feature-to/m-p/1016437#M42979</link>
    <description>&lt;P&gt;How can I write code to make a field attribute from one service/feature to show up in a pop-up of another service/feature that is in the same map in ArcGIS online?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not a developer and have tried to follow some videos and tutorials, but all seems too advanced for me.&amp;nbsp; No intersects/geometry involved, just using services/fields that have a relationship. This data is being collected in Survey123.&lt;/P&gt;&lt;P&gt;My scenario:&amp;nbsp; I would like the field attribute "Day of Work" that is in Line Clearance Contractor-Daily Trimming Report to show up in the pop-up of the repeat location service.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ElizabethHovsepian_0-1610556226852.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3726iDB29C5429B15E5B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ElizabethHovsepian_0-1610556226852.png" alt="ElizabethHovsepian_0-1610556226852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am creating a dashboard using this information and having it in one spot would be so very helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Elizabeth&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2021 17:20:33 GMT</pubDate>
    <dc:creator>ElizabethHovsepian</dc:creator>
    <dc:date>2021-01-13T17:20:33Z</dc:date>
    <item>
      <title>Code to make a field from one service/feature to show up in a pop-up of another service/feature that is in the same map?</title>
      <link>https://community.esri.com/t5/data-management-questions/code-to-make-a-field-from-one-service-feature-to/m-p/1016437#M42979</link>
      <description>&lt;P&gt;How can I write code to make a field attribute from one service/feature to show up in a pop-up of another service/feature that is in the same map in ArcGIS online?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not a developer and have tried to follow some videos and tutorials, but all seems too advanced for me.&amp;nbsp; No intersects/geometry involved, just using services/fields that have a relationship. This data is being collected in Survey123.&lt;/P&gt;&lt;P&gt;My scenario:&amp;nbsp; I would like the field attribute "Day of Work" that is in Line Clearance Contractor-Daily Trimming Report to show up in the pop-up of the repeat location service.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ElizabethHovsepian_0-1610556226852.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3726iDB29C5429B15E5B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ElizabethHovsepian_0-1610556226852.png" alt="ElizabethHovsepian_0-1610556226852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am creating a dashboard using this information and having it in one spot would be so very helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Elizabeth&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 17:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/code-to-make-a-field-from-one-service-feature-to/m-p/1016437#M42979</guid>
      <dc:creator>ElizabethHovsepian</dc:creator>
      <dc:date>2021-01-13T17:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Code to make a field from one service/feature to show up in a pop-up of another service/feature that is in the same map?</title>
      <link>https://community.esri.com/t5/data-management-questions/code-to-make-a-field-from-one-service-feature-to/m-p/1016510#M42982</link>
      <description>&lt;P&gt;It's a little hard to know without seeing the full schema of your layers. Are they truly &lt;EM&gt;related&lt;/EM&gt;, and part of the same service, or do they simply share a field?&lt;/P&gt;&lt;P&gt;I've got a very similar solution in one of my webmaps I'd be happy to share with you, but it depends a lot on how the layers are set up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="5"&gt;The Not-Actually-Related Layer Solution&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;Given two layers, &lt;STRONG&gt;parcels&lt;/STRONG&gt; and &lt;STRONG&gt;parcel sales&lt;/STRONG&gt;, I can use the following &lt;STRONG&gt;Arcade&lt;/STRONG&gt; expression on the &lt;STRONG&gt;parcels&lt;/STRONG&gt; layer to bring in an attribute from the &lt;STRONG&gt;sales &lt;/STRONG&gt;table.&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;// Assign feature id field to variable
var id = $feature.pin

// Get other layer
var otherLayer = FeatureSetByName($map,"Parcel_Sales")

// Filter other layer by matching id
var otherFeatures = Filter(otherLayer, 'property_key = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972"&gt;@ID&lt;/a&gt;')

// Sort returned features
var sortedFeatures = OrderBy(otherFeatures, 'sale_date DESC')

// Grab the first feature in the FeatureSet
var f = First(sortedFeatures)

// Return sale amount of latest sale
return f.sale_amount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how it looks in action:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jCarlson_1-1610570845075.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3793i07512376F3B3D75C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jCarlson_1-1610570845075.png" alt="jCarlson_1-1610570845075.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, there's no reason some of those functions couldn't be combined into one, but I kept them all separate for clarity.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 20:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/code-to-make-a-field-from-one-service-feature-to/m-p/1016510#M42982</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-01-13T20:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Code to make a field from one service/feature to show up in a pop-up of another service/feature that is in the same map?</title>
      <link>https://community.esri.com/t5/data-management-questions/code-to-make-a-field-from-one-service-feature-to/m-p/1019250#M43007</link>
      <description>&lt;P&gt;Thanks Josh! I will give my best go at it and see if I can follow your example to get what I am striving towards!&lt;/P&gt;&lt;P&gt;Elizabeth&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 20:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/code-to-make-a-field-from-one-service-feature-to/m-p/1019250#M43007</guid>
      <dc:creator>ElizabethHovsepian</dc:creator>
      <dc:date>2021-01-22T20:12:45Z</dc:date>
    </item>
  </channel>
</rss>

