<?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: ARCED expression for PopUp in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1117676#M43003</link>
    <description>&lt;P&gt;If I understand correctly, it sounds like an simple if/else will get it done for you.&lt;/P&gt;&lt;P&gt;Happy to help iif you need assitance setting up the argument.&lt;/P&gt;&lt;P&gt;if ( IsEmpty($feature["OCC_ELUM"] )) {&lt;BR /&gt;return "A"&lt;BR /&gt;}&lt;BR /&gt;else&amp;nbsp; {&lt;BR /&gt;return "B"&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2021 14:30:37 GMT</pubDate>
    <dc:creator>JasonGlidewell</dc:creator>
    <dc:date>2021-11-17T14:30:37Z</dc:date>
    <item>
      <title>ARCED expression for PopUp</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1117673#M43002</link>
      <description>&lt;PRE&gt;&lt;SPAN class=""&gt;I want to configure a Popup in a webmap in AGOL
I have data fields that define purposes in a particular area.&lt;BR /&gt; for Example: Purpose A field  - if the purpose exists the field value will be- Purpose A, and so on

I want only the fields that have a value to appear in the popup
Purpose A-Butterfly Garden&lt;BR /&gt;Purpose B-Null&lt;BR /&gt;Purpose C-Null&lt;BR /&gt;Purpose D-Dog Garden&lt;BR /&gt;Purpose E-Null&lt;BR /&gt;the Wonted end result - &lt;BR /&gt;Butterfly Garden, Dog Garden&lt;BR /&gt;&lt;BR /&gt;and not&lt;BR /&gt;Butterfly Garden, , , Dog Garden,&lt;BR /&gt; 
I was thinking of writing an expression in ARCED that would create the list

How do I write in ARCED an expression that asks first if there is a value in the field before it  plants the value in the POPUP  to avoid empty spaces&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Ori&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 14:26:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1117673#M43002</guid>
      <dc:creator>HarishMuni</dc:creator>
      <dc:date>2021-11-17T14:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: ARCED expression for PopUp</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1117676#M43003</link>
      <description>&lt;P&gt;If I understand correctly, it sounds like an simple if/else will get it done for you.&lt;/P&gt;&lt;P&gt;Happy to help iif you need assitance setting up the argument.&lt;/P&gt;&lt;P&gt;if ( IsEmpty($feature["OCC_ELUM"] )) {&lt;BR /&gt;return "A"&lt;BR /&gt;}&lt;BR /&gt;else&amp;nbsp; {&lt;BR /&gt;return "B"&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 14:30:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1117676#M43003</guid>
      <dc:creator>JasonGlidewell</dc:creator>
      <dc:date>2021-11-17T14:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: ARCED expression for PopUp</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1118047#M43020</link>
      <description>&lt;LI-CODE lang="javascript"&gt;// build an array of the purpose field values
var purposes = [
  $feature.PurposeA,
  $feature.PurposeB,
  $feature.PurposeC,
  $feature.PurposeD,
  $feature.PurposeE
]
// use that to build an array of non-empty purpose values
var non_empty_purposes = []                  // empty array
for(var p in purposes) {                     // loop through purposes
  if(!IsEmpty(purposes[p])) {                // if purpose is not empty (null or "")
    Push(non_empty_purposes, purposes[p])    // append to array
  }
}
// return the concatenated array as string
return Concatenate(non_empty_purposes, ", ")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Nov 2021 06:48:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1118047#M43020</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-11-18T06:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: ARCED expression for PopUp</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1118051#M43021</link>
      <description>&lt;P&gt;A simple if/else is not going to work here, because any number of purpose fields can have values. If you do a simple if/else chain like below, only the first purpose will be returned, completely ignoring possible other purposes.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// THIS IS WRONG, DON'T DO THIS
if(!IsEmpty($feature.PurposeA)) {
  // if PurposeA is filled ("Butterfly Garden" in the example), the expression will end here.
  // Other purpose fields (PurposeD - "Dog Garden") will be ignored!
  return $feature.PurposeA
}
if(!IsEmpty($feature.PurposeB)) {
  return $feature.PurposeB
}
if(!IsEmpty($feature.PurposeC)) {
  return $feature.PurposeC
}
if(!IsEmpty($feature.PurposeD)) {
  return $feature.PurposeD
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 18 Nov 2021 06:54:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1118051#M43021</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-11-18T06:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: ARCED expression for PopUp</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1118134#M43025</link>
      <description>&lt;P&gt;Maybe I am misunderstanding, but the way I've done this in the past is to use nested arguements in the if expression.&lt;/P&gt;&lt;P&gt;EX. if(IsEmpty($feature.Field_A)) &amp;amp;&amp;amp;&amp;nbsp;(IsEmpty($feature.Field_B)) == false){&lt;/P&gt;&lt;P&gt;return&amp;nbsp;$feature.Field_B&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 13:39:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arced-expression-for-popup/m-p/1118134#M43025</guid>
      <dc:creator>JasonGlidewell</dc:creator>
      <dc:date>2021-11-18T13:39:33Z</dc:date>
    </item>
  </channel>
</rss>

