<?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 Configuring pop up based on attribute value in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671200#M100677</link>
    <description>&lt;P&gt;We are trying to configure pop-up and one of the requirements is to display certain fields based on an query.&lt;/P&gt;&lt;P&gt;example, if field A = 1 then display field X, Y, Z and the value in these fields&lt;/P&gt;&lt;P&gt;else if field A = 2 then display field X and Y only and the value in these fields.&lt;/P&gt;&lt;P&gt;else if field A = 3 then display field Z only and the value in these fields.&lt;/P&gt;&lt;P&gt;We tried to use Arcade expression but it seems to be either adding new rows with variable name in Arcade and then pulling up values from these fields. I don't want to join them or have any new rows from Arcade variable.&lt;/P&gt;&lt;P&gt;Does anyone have configured such pop-ups and will it has potential to be an issue later on once we publish web maps?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any directions will be helpful.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Dec 2025 12:03:57 GMT</pubDate>
    <dc:creator>samshrma998</dc:creator>
    <dc:date>2025-12-08T12:03:57Z</dc:date>
    <item>
      <title>Configuring pop up based on attribute value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671200#M100677</link>
      <description>&lt;P&gt;We are trying to configure pop-up and one of the requirements is to display certain fields based on an query.&lt;/P&gt;&lt;P&gt;example, if field A = 1 then display field X, Y, Z and the value in these fields&lt;/P&gt;&lt;P&gt;else if field A = 2 then display field X and Y only and the value in these fields.&lt;/P&gt;&lt;P&gt;else if field A = 3 then display field Z only and the value in these fields.&lt;/P&gt;&lt;P&gt;We tried to use Arcade expression but it seems to be either adding new rows with variable name in Arcade and then pulling up values from these fields. I don't want to join them or have any new rows from Arcade variable.&lt;/P&gt;&lt;P&gt;Does anyone have configured such pop-ups and will it has potential to be an issue later on once we publish web maps?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any directions will be helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 12:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671200#M100677</guid>
      <dc:creator>samshrma998</dc:creator>
      <dc:date>2025-12-08T12:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring pop up based on attribute value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671245#M100682</link>
      <description>&lt;P&gt;Depends on how fancy you want to get, honestly.&lt;/P&gt;&lt;P&gt;It sounds like you probably want&amp;nbsp;the classic "Don't show empty fields" thing.&amp;nbsp;&lt;A href="https://support.esri.com/en-us/knowledge-base/how-to-replace-or-omit-empty-attribute-fields-from-disp-000026998" target="_blank"&gt;How To: Replace or Omit Empty Attribute Fields from Displaying in Pop-Ups Using a Custom A&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But this is a pretty simple way to do it. I remove all the fields I don't care about and then add the ones I do care about back in as an &lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/pop-ups-arcade-essentials#elem" target="_self"&gt;Arcade Element&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//This expression uses HTML tags (&amp;lt;b&amp;gt; and &amp;lt;br&amp;gt;) for formatting. 
//If you do not want them, take them out.
//That being said, if you use HTML for one thing, you're stuck with it for everything. 
//You can't use TextFormatting.NewLine with it, 
//    for example, so that's why I'm using &amp;lt;br&amp;gt;.

//Define output text array
var out = []
//Add the fields I always want
var name = $feature.Name
name = `&amp;lt;b&amp;gt;Name&amp;lt;/b&amp;gt;: ${name}`
var ftype = $feature.FeatType
ftype = `&amp;lt;b&amp;gt;FeatType&amp;lt;/b&amp;gt;: ${ftype}`
Push(out, name)
Push(out, ftype)


// Define the variables for the fields I sometimes want
var x = $feature.FieldX
x = `&amp;lt;b&amp;gt;FieldX&amp;lt;/b&amp;gt;: ${x}`
var y = $feature.FieldY
y = `&amp;lt;b&amp;gt;FieldY&amp;lt;/b&amp;gt;: ${y}`
var z = $feature.FieldZ
z = `&amp;lt;b&amp;gt;FieldZ&amp;lt;/b&amp;gt;: ${z}`

//Add the variables to the output depending on FeatType
if ($feature.FeatType == "1"){
    Push(out, x)
    Push(out, y)
    Push(out, z)
} else if ($feature.FeatType == "2"){
    Push(out, x)
    Push(out, y)
}else {
    Push(out, z)
}
//Add a new line between each field
out = concatenate(out, "&amp;lt;br&amp;gt;")

//Return your output
return { 
  	type : 'text', 
text : out 
}&lt;/LI-CODE&gt;&lt;P&gt;3 features with the same attributes except for FeatType&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_3-1765207942685.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/144994i4003F7CB867AD577/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_3-1765207942685.png" alt="AlfredBaldenweck_3-1765207942685.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AlfredBaldenweck_3-1765207942685.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_0-1765207780641.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/144990i3E575B516968CECE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlfredBaldenweck_0-1765207780641.png" alt="AlfredBaldenweck_0-1765207780641.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AlfredBaldenweck_0-1765207780641.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_1-1765207787744.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/144991i1281E0E6C6CB2A1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlfredBaldenweck_1-1765207787744.png" alt="AlfredBaldenweck_1-1765207787744.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AlfredBaldenweck_1-1765207787744.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_2-1765207795532.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/144992iF0317E8A45977591/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AlfredBaldenweck_2-1765207795532.png" alt="AlfredBaldenweck_2-1765207795532.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;AlfredBaldenweck_2-1765207795532.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 15:32:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671245#M100682</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2025-12-08T15:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring pop up based on attribute value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671290#M100690</link>
      <description>&lt;P&gt;This can be done with Arcade as shown in the very helpful example posted by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;, but you might want to upvote these ideas as well:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-ideas/conditional-visibility-for-popup-elements/idi-p/1409281" target="_blank" rel="noopener"&gt;Conditional visibility for popup elements - Esri Community&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-ideas/map-viewer-enable-pop-up-elements-with-conditions/idi-p/1198990" target="_blank"&gt;Map Viewer: Enable Pop Up Elements with Conditions... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 17:04:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671290#M100690</guid>
      <dc:creator>HollyTorpey_LSA</dc:creator>
      <dc:date>2025-12-08T17:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring pop up based on attribute value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671309#M100691</link>
      <description>&lt;P&gt;Oh cool, I hadn't seen one of those.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 17:15:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671309#M100691</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2025-12-08T17:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring pop up based on attribute value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671491#M100710</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;, Thanks for suggestions!!&lt;/P&gt;&lt;P&gt;While the expression you provided meets our requirement but it loses the look and feel ArcGIS pro provides.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We were able to write an expression which worked for us while retaining the original feel of pro map. Here is expression we used and results.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var s = Schema($feature);&lt;BR /&gt;var allFields = [];&lt;BR /&gt;for (var i = 0; i &amp;lt; Count(s.fields); i++) {&lt;BR /&gt;var f = s.fields[i];&lt;BR /&gt;Push(allFields, { fieldName: f.name });&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return When(&lt;BR /&gt;// FeatType 1&lt;BR /&gt;$feature.FeatType == 1,&lt;BR /&gt;{&lt;BR /&gt;type: 'fields',&lt;BR /&gt;fieldInfos: [&lt;BR /&gt;{ fieldName: "Name" },&lt;BR /&gt;{ fieldName: "FieldX" },&lt;BR /&gt;{ fieldName: "FieldY" },&lt;BR /&gt;{ fieldName: "FieldZ" }&lt;BR /&gt;]&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;// FeatType 2&lt;BR /&gt;$feature.FeatType == 2,&lt;BR /&gt;{&lt;BR /&gt;type: 'fields',&lt;BR /&gt;fieldInfos: [&lt;BR /&gt;{ fieldName: "Name" },&lt;BR /&gt;{ fieldName: "FieldX" },&lt;BR /&gt;{ fieldName: "FieldY" }&lt;BR /&gt;]&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;// FeatType 3&lt;BR /&gt;$feature.FeatType == 3,&lt;BR /&gt;{&lt;BR /&gt;type: 'fields',&lt;BR /&gt;fieldInfos: [&lt;BR /&gt;{ fieldName: "Name" },&lt;BR /&gt;{ fieldName: "FieldZ" }&lt;BR /&gt;]&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;// Default (only once, and last)&lt;BR /&gt;{&lt;BR /&gt;type: 'fields',&lt;BR /&gt;fieldInfos: allFields&lt;BR /&gt;}&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="samshrma998_0-1765271852098.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/145053i7287CDAC0FA56E39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="samshrma998_0-1765271852098.png" alt="samshrma998_0-1765271852098.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;samshrma998_0-1765271852098.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="samshrma998_1-1765271933657.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/145054i37ABD15C71E01646/image-size/medium?v=v2&amp;amp;px=400" role="button" title="samshrma998_1-1765271933657.png" alt="samshrma998_1-1765271933657.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;samshrma998_1-1765271933657.png&lt;/span&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>Tue, 09 Dec 2025 09:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671491#M100710</guid>
      <dc:creator>samshrma998</dc:creator>
      <dc:date>2025-12-09T09:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring pop up based on attribute value</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671591#M100711</link>
      <description>&lt;P&gt;Oh sweet, glad you got it worked out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be honest, I didn't realize there was an Arcade fields element. That definitely fits it better.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 14:12:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/configuring-pop-up-based-on-attribute-value/m-p/1671591#M100711</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2025-12-09T14:12:30Z</dc:date>
    </item>
  </channel>
</rss>

