<?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: Using Arcade to Combine Fields if the field isn't empty in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521724#M60854</link>
    <description>&lt;P&gt;I left missed the closing parenthesis for the GPS text. Since I can't edit my post, it's updated here&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;IIf (IsEmpty($feature.GPS),
  `${$feature.Site}: ${$feature.Latitude}, ${$feature.Longitude}`,
  `${$feature.Site} (${$feature.GPS}): ${$feature.Latitude}, ${$feature.Longitude}`
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2024 18:52:43 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-08-14T18:52:43Z</dc:date>
    <item>
      <title>Using Arcade to Combine Fields if the field isn't empty</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521704#M60850</link>
      <description>&lt;P&gt;I'm currently using arcade in a popup to combine 4 fields into a single line in one field. This code below works but I'd like to make it better/cleaner, since it's possible that the "GPS" field is empty. I'm sure there is a way to write what is in the GPS field in parenthesis only if it has text in it, and not write anything if it is empty. I'm new to arcade and just struggling on how to write the logic for when and if statements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently if the GPS field doesn't have text in it the code writes:&lt;/P&gt;&lt;P&gt;SiteName (): Lat, Long&lt;/P&gt;&lt;P&gt;Trying to get to:&lt;/P&gt;&lt;P&gt;If GPS does have text in it: SiteName (GPS abbreviation): Lat, Long&lt;/P&gt;&lt;P&gt;If GPS does not have text in it: SiteName: Lat, Long&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var oneline = $feature.Site + " (" + $feature.GPS + "): " + $feature.Latitude + ", " + $feature.Longitude 

return oneline&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 18:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521704#M60850</guid>
      <dc:creator>diamondu</dc:creator>
      <dc:date>2024-08-14T18:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade to Combine Fields if the field isn't empty</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521720#M60852</link>
      <description>&lt;P&gt;You can do that this way. This uses an &lt;A href="https://developers.arcgis.com/arcade/guide/return/#implicit-returns" target="_self"&gt;implicit return&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;IIf (IsEmpty($feature.GPS),
  `${$feature.Site}: ${$feature.Latitude}, ${$feature.Longitude}`,
  `${$feature.Site} (${$feature.GPS}: ${$feature.Latitude}, ${$feature.Longitude}`
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 18:50:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521720#M60852</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-14T18:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade to Combine Fields if the field isn't empty</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521724#M60854</link>
      <description>&lt;P&gt;I left missed the closing parenthesis for the GPS text. Since I can't edit my post, it's updated here&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;IIf (IsEmpty($feature.GPS),
  `${$feature.Site}: ${$feature.Latitude}, ${$feature.Longitude}`,
  `${$feature.Site} (${$feature.GPS}): ${$feature.Latitude}, ${$feature.Longitude}`
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 18:52:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521724#M60854</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-14T18:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade to Combine Fields if the field isn't empty</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521774#M60857</link>
      <description>&lt;P&gt;Thank you so so much!!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 19:52:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/using-arcade-to-combine-fields-if-the-field-isn-t/m-p/1521774#M60857</guid>
      <dc:creator>diamondu</dc:creator>
      <dc:date>2024-08-14T19:52:32Z</dc:date>
    </item>
  </channel>
</rss>

