<?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: Arcade - Replacing null values with a custom value within a dictionnary in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-replacing-null-values-with-a-custom-value/m-p/1417042#M9519</link>
    <description>&lt;P&gt;The dictionary contained the field "ArrivalTime" but you were assigning 0 to "Arrival_Time".&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (var t in Length_Canada) { 
  combinedDict.features[i++] = { 
    attributes: {
      Shape_Length: t["Shape__Length"],
      ArrivalTime: 0
    }, 
    geometry: Geometry(t)
  }; 
} &lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 30 Apr 2024 14:48:51 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-04-30T14:48:51Z</dc:date>
    <item>
      <title>Arcade - Replacing null values with a custom value within a dictionnary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-replacing-null-values-with-a-custom-value/m-p/1416963#M9518</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm very new to Arcade, and am working to populate an indicator from multiple feature layers.&lt;/P&gt;&lt;P&gt;My problem is that I have a value, called "ArrivalTime" (which is a number) that some layers have, and others don't. When I execute the code, the layers that do not have an "ArrivalTime" show this value as "null" and I cannot filter based on it, they just get excluded automatically.&lt;/P&gt;&lt;P&gt;My question is, I'd like to replace this "null" value by a 0, so that I can filter on them the same as the layers that do have an "ArrivalTime" value.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var Length_Canada = FeatureSetByPortalItem(port, '5ae0748d2b454853bcf47bffc3245a39', 12, ['*'], true)
var Length_Australia = FeatureSetByPortalItem(port, '44708b8c1c2f4338835e51baee64d1a9', 9, ['*'], true)

Console(Length_Australia)
Console(Length_Canada)
var combinedDict = { 
  'fields': [ 
    { name: "Shape_Length", type:"esriFieldTypeDouble" },
    { name: "ArrivalTime", type:"esriFieldTypeDouble" },
  ], 
  geometryType: "esriGeometryPolyline", 
  features: [], 
}; var i = 0; 

for (var t in Length_Canada) { 
  combinedDict.features[i++] = { 
    attributes: {
      Shape_Length: t["Shape__Length"],
      Arrival_Time: "0"
    }, 
    geometry: Geometry(t)
  }; 
} for (var m in Length_Australia) { 
  combinedDict.features[i++] = { 
    attributes: { 
      Shape_Length: m["Shape__Length"],
      ArrivalTime: m["ArrivalTime"]
    }, 
    geometry: Geometry(m)
  }; 
}
return FeatureSet(combinedDict)&lt;/LI-CODE&gt;&lt;P&gt;Here is the code, as the Canada layers do not have any "ArrivalTime" value, I'm trying to force a 0 as the default value (line 19), but it keeps on returning a null value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RemyOlive_0-1714478055522.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/102552iD92125566BF0CA22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RemyOlive_0-1714478055522.png" alt="RemyOlive_0-1714478055522.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is an example of the return table that I get.&lt;/P&gt;&lt;P&gt;Any help would be appreciated,&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Rémy&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 11:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-replacing-null-values-with-a-custom-value/m-p/1416963#M9518</guid>
      <dc:creator>RemyOlive</dc:creator>
      <dc:date>2024-04-30T11:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Replacing null values with a custom value within a dictionnary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-replacing-null-values-with-a-custom-value/m-p/1417042#M9519</link>
      <description>&lt;P&gt;The dictionary contained the field "ArrivalTime" but you were assigning 0 to "Arrival_Time".&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (var t in Length_Canada) { 
  combinedDict.features[i++] = { 
    attributes: {
      Shape_Length: t["Shape__Length"],
      ArrivalTime: 0
    }, 
    geometry: Geometry(t)
  }; 
} &lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 30 Apr 2024 14:48:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-replacing-null-values-with-a-custom-value/m-p/1417042#M9519</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-30T14:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade - Replacing null values with a custom value within a dictionnary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-replacing-null-values-with-a-custom-value/m-p/1417046#M9520</link>
      <description>&lt;P&gt;Oh right it works now,&lt;/P&gt;&lt;P&gt;Thank you so much !! Why couldn't I have seen that earlier,&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Rémy&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 14:57:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-replacing-null-values-with-a-custom-value/m-p/1417046#M9520</guid>
      <dc:creator>RemyOlive</dc:creator>
      <dc:date>2024-04-30T14:57:08Z</dc:date>
    </item>
  </channel>
</rss>

