<?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: Attribute expression - show/hide fields if value is NULL in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518424#M60784</link>
    <description>&lt;P&gt;You'll have to use an &lt;A href="https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups-mv.htm#ESRI_SECTION1_F5CB09E0313A4DA1BD10F18D875FFC3F" target="_self"&gt;Arcade element&lt;/A&gt;, which can return html code.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var output = iif
( 
  IsEmpty($feature.Case_Study), " ",
  `Read the ${$feature.Short_Title} &amp;lt;a href="${feature.Case_Study}"&amp;gt;Case Study&amp;lt;/a&amp;gt;`
);

return { 
	type : 'text', 
	text : output 
}&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 12 Aug 2024 15:18:00 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-08-12T15:18:00Z</dc:date>
    <item>
      <title>Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518249#M60775</link>
      <description>&lt;P&gt;Hi everyone -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This will probably be very straightforward for the right person but my working knowledge of Arcade and attribute expressions is next to nothing: I was ecstatic when I managed to write an expression to convert m2 to ha and round it to 2 decimal places&amp;nbsp;but I need some assistance with something a little more complicated ...&lt;BR /&gt;&lt;BR /&gt;I have two fields in layer - {status} and {expected_delivery}.&amp;nbsp; Where {status} is "Delivered since 2018" there is nothing in {expected_delivery} but where {status} is "Active", "Pipeline" or "Opportunity" there may be additional information in {expected_delivery} ... but not always!&lt;BR /&gt;&lt;BR /&gt;What I want to do is write an expression that will show {status} if {expected_delivery} is blank; and {status} &amp;amp; " ," &amp;amp; {expected_delivery} if {expected_delivery} is&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; blank.&lt;/P&gt;&lt;P&gt;I found some information on If expressions that looked like it might do the trick but I couldn't get it to output what I was after and it didn't take too long to realise I was out of my depth - any ideas?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 09:51:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518249#M60775</guid>
      <dc:creator>petera</dc:creator>
      <dc:date>2024-08-12T09:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518321#M60779</link>
      <description>&lt;P&gt;Here's an example how to do that using &lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#iif" target="_self"&gt;IIf&lt;/A&gt;, &lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#isempty" target="_self"&gt;IsEmpty&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/arcade/guide/template-literals/" target="_self"&gt;template literals&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return iif(
  IsEmpty($feature.expected_delivery),
  status,
  `${$feature.status}, ${$feature.expected_delivery}`
);&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;</description>
      <pubDate>Mon, 12 Aug 2024 13:21:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518321#M60779</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-12T13:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518361#M60782</link>
      <description>&lt;P&gt;Thanks Ken, that worked perfectly!&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return iif
( 
  IsEmpty($feature.Expected_Delivery), $feature.Status,
  `${$feature.Status}, ${$feature.Expected_Delivery}`
);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; The attribute expression gives the two different outputs I was after at the bottom of the popups:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled-2.jpg" style="width: 989px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112134i146C4E88B2BA5DC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled-2.jpg" alt="Untitled-2.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;This is going to save me a lot of time writing definition queries and making custom popups for things!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 14:04:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518361#M60782</guid>
      <dc:creator>petera</dc:creator>
      <dc:date>2024-08-12T14:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518395#M60783</link>
      <description>&lt;P&gt;As a follow up, is it possible to include hyperlinks in this sort of thing?&lt;/P&gt;&lt;P&gt;There are a number of projects that have either case studies, websites or both associated with them.&amp;nbsp; At the moment, I have to make a layer filtered to show only those that have the case studies and/or website and write the following into the popups for them:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;p&amp;gt;
    Read the {Short_Title} &amp;lt;a href="{Case_Study}" target="_blank"&amp;gt;Case Study&amp;lt;/a&amp;gt;.
&amp;lt;/p&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;To make this sort of thing where "Railway and Bus Station Masterplan" is the {Short_Title} and URL for the hyperlink is the {Case_Study} field.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hyperlink.jpg" style="width: 504px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/112145i75C79EFF888795E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="hyperlink.jpg" alt="hyperlink.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I altered the first expression to show nothing if the Case Study URL field is empty but to display the text part if there is a Case Study URL but I have no clue if it is possible to make the words "Case Study" into a clickable link with the field[Case_Study} as the destination.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return iif
( 
  IsEmpty($feature.Case_Study), " ",
  `Read the ${$feature.Short_Title} Case Study`
);&lt;/LI-CODE&gt;&lt;P&gt;Is this even possible within the attribute expressions?&lt;/P&gt;&lt;P&gt;Thanks again for any ideas - really appreciate it!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 14:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518395#M60783</guid>
      <dc:creator>petera</dc:creator>
      <dc:date>2024-08-12T14:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518424#M60784</link>
      <description>&lt;P&gt;You'll have to use an &lt;A href="https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups-mv.htm#ESRI_SECTION1_F5CB09E0313A4DA1BD10F18D875FFC3F" target="_self"&gt;Arcade element&lt;/A&gt;, which can return html code.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var output = iif
( 
  IsEmpty($feature.Case_Study), " ",
  `Read the ${$feature.Short_Title} &amp;lt;a href="${feature.Case_Study}"&amp;gt;Case Study&amp;lt;/a&amp;gt;`
);

return { 
	type : 'text', 
	text : output 
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 12 Aug 2024 15:18:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1518424#M60784</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-12T15:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705077#M68771</link>
      <description>&lt;P&gt;Hi! I'm trying to get this to work with my map and data. And it isn't working. It just doesn't show the link in the popup. Is this still valid code for today's ArcGIS Online arcade element?&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2026 20:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705077#M68771</guid>
      <dc:creator>AndreaB_</dc:creator>
      <dc:date>2026-05-28T20:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705167#M68774</link>
      <description>&lt;P&gt;The code still works when I test it in the Map Viewer. Can you post your code?&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2026 13:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705167#M68774</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2026-05-29T13:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705210#M68778</link>
      <description>&lt;P&gt;Sure, thanks.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var output = iif
( 
  IsEmpty($feature.Link2), " ",
  `&amp;lt;a href="${feature.Link2}"&amp;gt;Library Reference&amp;lt;/a&amp;gt;`
);

return { 
	type : 'text', 
	text : output
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2026 15:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705210#M68778</guid>
      <dc:creator>AndreaB_</dc:creator>
      <dc:date>2026-05-29T15:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705262#M68780</link>
      <description>&lt;P&gt;Can you show what some of the values of Link2 are?&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2026 17:25:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705262#M68780</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2026-05-29T17:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute expression - show/hide fields if value is NULL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705296#M68782</link>
      <description>&lt;P&gt;The field was created in ArcGIS Online into the hosted feature layer and has a field display name on it of "Additional Link". I only have one value in that field right now:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndreaB__0-1780083537966.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/153250iB2C44DE94A8954FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndreaB__0-1780083537966.png" alt="AndreaB__0-1780083537966.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The url value is:&amp;nbsp;&lt;A href="https://circusworld.catalogaccess.com/objects/284" target="_blank"&gt;https://circusworld.catalogaccess.com/objects/284&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2026 19:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/attribute-expression-show-hide-fields-if-value-is/m-p/1705296#M68782</guid>
      <dc:creator>AndreaB_</dc:creator>
      <dc:date>2026-05-29T19:41:14Z</dc:date>
    </item>
  </channel>
</rss>

