<?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: Query FC for value and hide or show link in popup in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284405#M51829</link>
    <description>&lt;P&gt;nah still having issues...Anyone see what I am doign wrong... I think the FOR loop should be going through all the values in the "Inspection Form FC" in the webmap&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var globalIDValue = $feature.GLOBALID
var relGlobalIDValue = FeatureSetByName($map,"Inspection Form FC",['REL_GLOBALID'], false)
var didIFindIt = ""

for (var i in relGlobalIDValue) {
    var compareValue = i
    var currentValue = globalIDValue
    //return currentValue

    if (currentValue == compareValue){
        didIFindIt = "Found It"
    }
}
return didIFindIt&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 16:28:49 GMT</pubDate>
    <dc:creator>kapalczynski</dc:creator>
    <dc:date>2023-05-01T16:28:49Z</dc:date>
    <item>
      <title>Query FC for value and hide or show link in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284373#M51824</link>
      <description>&lt;P&gt;I have an odd question.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I have a Feature Class that is in Oracle SDE, published to ArcGIS Server, Registered in Portal&lt;/LI&gt;&lt;LI&gt;I edit this FC using Field Maps.&lt;/LI&gt;&lt;LI&gt;In the Webmap that Field Map uses I have a link that opens a Survey123 Form and allows the user to create/edit a record in a 2nd Feature Class which is also in Oracle SDE, published to ArcGIS Server, Registered in Portal.&lt;/LI&gt;&lt;LI&gt;There is no current relationship set up with these 2 Feature Classes....although when the S123 Form is opened the GlobalID of the 1st FC is passed and stored in the 2nd FC.&amp;nbsp; So I can query on this...&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In Field Maps I want to be able to click a feature and have the popup open (works fine)&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I want to be able to click the link and open S123 to add/edit the 2nd FC (works fine)&lt;/LI&gt;&lt;LI&gt;BUT I want to be able to HIDE the link if it already has a record in the 2nd Feature Class..&lt;/LI&gt;&lt;LI&gt;NOTE the 2nd Feature Class has Its GlobalID and the Global ID from the 1st FC.&amp;nbsp; So I can technically query for the Global ID and see if it exists.... BUT I am not sure how to do this in a Popup...&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I assume this would be an Arcade Expression?&amp;nbsp; But can you query a FC in a popup?&amp;nbsp; If I get a YES I can show a link and if it is NO then I can show the link&lt;/P&gt;&lt;P&gt;I hope that makes sense....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 15:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284373#M51824</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-05-01T15:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Query FC for value and hide or show link in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284392#M51825</link>
      <description>&lt;P&gt;It appears that I can access the WebMap from expression builder for popups ...&amp;nbsp; I can see the 2nd Table in there but not sure how to access the attributes from it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the expression builder I can see the webmap that has the FC I am looking to query.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_0-1682955784964.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69586iB22B0682DF53C3CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kapalczynski_0-1682955784964.png" alt="kapalczynski_0-1682955784964.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the Table I want to query for a specific value ... if exists return true if not return false&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_1-1682955861561.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69587iA32DD610E1F4E70F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kapalczynski_1-1682955861561.png" alt="kapalczynski_1-1682955861561.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I query it with Arcade Expression....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EX:&amp;nbsp; If $feature.fieldValue == "something"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return True&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 15:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284392#M51825</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-05-01T15:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Query FC for value and hide or show link in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284395#M51826</link>
      <description>&lt;P&gt;I think I can walk to the WebMap and Feature Class as such&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;var relGlobalID = ($map,"Inspection Form FC")&lt;/P&gt;&lt;P&gt;BUT How do I query this Feature Class in the webmap looking for a specific value in the attribute field?&lt;/P&gt;&lt;P&gt;the attribute field name is relGlobalID&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>Mon, 01 May 2023 15:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284395#M51826</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-05-01T15:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Query FC for value and hide or show link in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284399#M51827</link>
      <description>&lt;P&gt;think I found it all here...&amp;nbsp;&lt;A href="https://learn.arcgis.com/en/projects/access-attributes-from-another-layer-with-arcade/" target="_blank"&gt;https://learn.arcgis.com/en/projects/access-attributes-from-another-layer-with-arcade/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 16:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284399#M51827</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-05-01T16:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Query FC for value and hide or show link in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284405#M51829</link>
      <description>&lt;P&gt;nah still having issues...Anyone see what I am doign wrong... I think the FOR loop should be going through all the values in the "Inspection Form FC" in the webmap&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var globalIDValue = $feature.GLOBALID
var relGlobalIDValue = FeatureSetByName($map,"Inspection Form FC",['REL_GLOBALID'], false)
var didIFindIt = ""

for (var i in relGlobalIDValue) {
    var compareValue = i
    var currentValue = globalIDValue
    //return currentValue

    if (currentValue == compareValue){
        didIFindIt = "Found It"
    }
}
return didIFindIt&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 16:28:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284405#M51829</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-05-01T16:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Query FC for value and hide or show link in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284448#M51833</link>
      <description>&lt;P&gt;OK I can do this :&amp;nbsp; Based on if there is a record in the 2nd Feature Classes it returns YES or NO in the popup....&lt;/P&gt;&lt;P&gt;But what I want to do is show NO in Text and if YES show a link to a S123 form...&lt;/P&gt;&lt;P&gt;HOW do I define the below URL into a link and show that in the popup ONLY if YES&lt;/P&gt;&lt;P&gt;&amp;lt;a href="arcgis-survey123://?itemID= cb33fc9a3xxxxxxxxxxxxx40146&amp;amp;amp;portalUrl=&lt;A href="https://website.gov/portal&amp;amp;amp;action=edit&amp;amp;amp;folder=inbox&amp;amp;amp;update=true&amp;amp;amp;filter=REL_GLOBALID:{GLOBALID}&amp;amp;amp;callback=arcgis-fieldmaps://?itemID=1cf5c7a03xxxxxxxxxxxx2c308a2" target="_blank"&gt;https://website.gov/portal&amp;amp;amp;action=edit&amp;amp;amp;folder=inbox&amp;amp;amp;update=true&amp;amp;amp;filter=REL_GLOBALID:{GLOBALID}&amp;amp;amp;callback=arcgis-fieldmaps://?itemID=1cf5c7a03xxxxxxxxxxxx2c308a2&lt;/A&gt;" rel="nofollow ugc" target="_blank"&amp;gt;Inspection Form&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var globalIDValue = $feature.GLOBALID
var relGlobalIDValue = FeatureSetByName($map,"Inspection Form",['REL_GLOBALID'], false)
var status = "NO INSPECTION"
for (var i in relGlobalIDValue) {
    var compareValue = Text(i.REL_GLOBALID)
    var currentValue = globalIDValue
    if (currentValue == compareValue){  
        status = "YES"
     }
}
return status&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_0-1682964293763.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69603i0E2095DB6AAD8900/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kapalczynski_0-1682964293763.png" alt="kapalczynski_0-1682964293763.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 18:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284448#M51833</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-05-01T18:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Query FC for value and hide or show link in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284485#M51838</link>
      <description>&lt;P&gt;I was able to hide one or the other with this example...&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-questions/using-arcade-or-html-to-hide-display-hyperlink-in/td-p/1040585" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-online-questions/using-arcade-or-html-to-hide-display-hyperlink-in/td-p/1040585&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Scroll down to comment by&amp;nbsp;&lt;SPAN&gt;by&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341" target="_self"&gt;&lt;SPAN class=""&gt;JohannesLindner&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;'My code that worked for me is below&lt;/P&gt;&lt;P&gt;Based on == or != in an IF I created to expressions...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the DIV and html in the popup showed me either one or the other.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;POPUP:
&amp;lt;tr style="background-color: rgb(255, 255, 255);" valign="top"&amp;gt;
&amp;lt;td style="padding: 2px;padding-bottom: 5px;border: 1px solid rgb(203, 203, 203);padding-right: 5px;color:rgb(74, 74, 74);"&amp;gt;Inspection Form
&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;
          &amp;lt;div style="display:{expression/expr1};"&amp;gt;
&amp;lt;a href="arcgis-survey123://?itemID= cb33fcxxxxxxx50722440146&amp;amp;amp;portalUrl=https://url.gov/portal&amp;amp;amp;action=edit&amp;amp;amp;folder=inbox&amp;amp;amp;update=true&amp;amp;amp;filter=REL_GLOBALID:{GLOBALID}&amp;amp;amp;callback=arcgis-fieldmaps://?itemID=1cf5c7a0xxxxxxxx2c308a2" rel="nofollow ugc" target="_blank"&amp;gt;Inspection Form 1&amp;lt;/a&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div style="display:{expression/expr2};"&amp;gt;
&amp;lt;a href="arcgis-survey123://?itemID= cb33fc9a378xxxxxxxxxxxx0722440146&amp;amp;amp;field:REL_GLOBALID={GLOBALID}&amp;amp;amp;field:GEOGRAPHICAL_LOCATION={LATITUDE},{LONGITUDE}" rel="nofollow ugc" target="_blank"&amp;gt;Inspection Form 2&amp;lt;br /&amp;gt;&amp;lt;/a&amp;gt;
              &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EXPRESSION 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var globalIDValue = $feature.GLOBALID
var relGlobalIDValue = FeatureSetByName($map,"Inspection Form",['REL_GLOBALID'], false)
var status = "none"
for (var i in relGlobalIDValue) {
    var compareValue = Text(i.REL_GLOBALID)
    var currentValue = globalIDValue
    if (currentValue != compareValue){  
        status = "inline"
      }
}
return status&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EXPRESSION 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var globalIDValue = $feature.GLOBALID
var relGlobalIDValue = FeatureSetByName($map,"Inspection Form",['REL_GLOBALID'], false)
var status = "none"
for (var i in relGlobalIDValue) {
    var compareValue = Text(i.REL_GLOBALID)
    var currentValue = globalIDValue
    if (currentValue == compareValue){  
        status = "inline"
     }
}
return status&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 19:50:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/query-fc-for-value-and-hide-or-show-link-in-popup/m-p/1284485#M51838</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-05-01T19:50:48Z</dc:date>
    </item>
  </channel>
</rss>

