<?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 Forcing a feature value to load in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/forcing-a-feature-value-to-load/m-p/1389343#M57785</link>
    <description>&lt;P&gt;Hello everyone while making a map with Arcade, i've encountered a problem&lt;/P&gt;&lt;P&gt;I have a DB with these fields:&lt;BR /&gt;city, year, pop2017, pop2018, pop2019...&lt;BR /&gt;&lt;BR /&gt;Where pop{...} are fields that contain the population for the selected year (so pop2017 is the population of this city in 2017), many project work on this DB but each year, we need to make new maps selecting the right year;&lt;BR /&gt;I tried to make this a bit more automatized by using this:&lt;BR /&gt;&lt;BR /&gt;`Current pop: ${$feature[`pop${$feature.year}`]}`&lt;BR /&gt;&lt;BR /&gt;But, by doning this, it return me a NaN, after searching the root of this problem, i notice that i needed first to "load" these fields like so:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//$feature.year is currently at 2022

Console($feature.pop2022) // Here i force this field to load

$feature[`pop${$feature.year}`] //Here i call it&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, i'm now back at the same point, each year, i'll need to manually add the $feature.pop.... to force it to load&lt;/P&gt;&lt;P&gt;Does anyone know if there is a clever way to do this ? Like a way to force features fields to load without writing by hand a call on this field ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please guys, help me&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2024 09:04:26 GMT</pubDate>
    <dc:creator>N0MAD</dc:creator>
    <dc:date>2024-03-01T09:04:26Z</dc:date>
    <item>
      <title>Forcing a feature value to load</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/forcing-a-feature-value-to-load/m-p/1389343#M57785</link>
      <description>&lt;P&gt;Hello everyone while making a map with Arcade, i've encountered a problem&lt;/P&gt;&lt;P&gt;I have a DB with these fields:&lt;BR /&gt;city, year, pop2017, pop2018, pop2019...&lt;BR /&gt;&lt;BR /&gt;Where pop{...} are fields that contain the population for the selected year (so pop2017 is the population of this city in 2017), many project work on this DB but each year, we need to make new maps selecting the right year;&lt;BR /&gt;I tried to make this a bit more automatized by using this:&lt;BR /&gt;&lt;BR /&gt;`Current pop: ${$feature[`pop${$feature.year}`]}`&lt;BR /&gt;&lt;BR /&gt;But, by doning this, it return me a NaN, after searching the root of this problem, i notice that i needed first to "load" these fields like so:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//$feature.year is currently at 2022

Console($feature.pop2022) // Here i force this field to load

$feature[`pop${$feature.year}`] //Here i call it&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, i'm now back at the same point, each year, i'll need to manually add the $feature.pop.... to force it to load&lt;/P&gt;&lt;P&gt;Does anyone know if there is a clever way to do this ? Like a way to force features fields to load without writing by hand a call on this field ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please guys, help me&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 09:04:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/forcing-a-feature-value-to-load/m-p/1389343#M57785</guid>
      <dc:creator>N0MAD</dc:creator>
      <dc:date>2024-03-01T09:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Forcing a feature value to load</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/forcing-a-feature-value-to-load/m-p/1389852#M57814</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/761010"&gt;@N0MAD&lt;/a&gt;&amp;nbsp;, arcade expression doesn't seem correct to me. Could you explain this with screenshots like what data looks like and what is needed as an output?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2024 04:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/forcing-a-feature-value-to-load/m-p/1389852#M57814</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2024-03-02T04:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Forcing a feature value to load</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/forcing-a-feature-value-to-load/m-p/1390222#M57824</link>
      <description>&lt;P&gt;For instance i have these lines:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;city&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;pop2021&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;pop2022&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;pop2023&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;ozone&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;Paris&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;123&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;456&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;789&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1.35&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;2022&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Each year, a new line will be added for each city, so for instance&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;city&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;pop2021&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;pop2022&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;pop2023&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;ozone&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%"&gt;Paris&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;123&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;456&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;789&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1.35&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Paris&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;TD&gt;456&lt;/TD&gt;&lt;TD&gt;789&lt;/TD&gt;&lt;TD&gt;3.41&lt;/TD&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;But since this table is made from a view, each year, a new population survey is made so a new field is added to the table 'population', so the view will look like this:&lt;/P&gt;&lt;TABLE border="1" width="547px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="93.6167px"&gt;city&lt;/TD&gt;&lt;TD width="93.8667px"&gt;pop2021&lt;/TD&gt;&lt;TD width="93.8667px"&gt;pop2022&lt;/TD&gt;&lt;TD width="78px"&gt;pop2023&lt;/TD&gt;&lt;TD width="44.9667px"&gt;pop2024&lt;/TD&gt;&lt;TD width="93.6833px"&gt;ozone&lt;/TD&gt;&lt;TD width="48px"&gt;year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6167px"&gt;Paris&lt;/TD&gt;&lt;TD width="93.8667px"&gt;123&lt;/TD&gt;&lt;TD width="93.8667px"&gt;456&lt;/TD&gt;&lt;TD width="78px"&gt;789&lt;/TD&gt;&lt;TD width="44.9667px"&gt;1011&lt;/TD&gt;&lt;TD width="93.6833px"&gt;1.35&lt;/TD&gt;&lt;TD width="48px"&gt;2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6167px"&gt;Paris&lt;/TD&gt;&lt;TD width="93.8667px"&gt;123&lt;/TD&gt;&lt;TD width="93.8667px"&gt;456&lt;/TD&gt;&lt;TD width="78px"&gt;789&lt;/TD&gt;&lt;TD width="44.9667px"&gt;1011&lt;/TD&gt;&lt;TD width="93.6833px"&gt;3.41&lt;/TD&gt;&lt;TD width="48px"&gt;2023&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;(the database schema isn't very clever for me but it's a previous worker that made it)&lt;BR /&gt;&lt;BR /&gt;So i need for each line to select the right population&lt;BR /&gt;&lt;BR /&gt;$feature.year = the year of the pollution row&lt;BR /&gt;$feature.pop{20..} = one of the fields from the table population&lt;BR /&gt;&lt;BR /&gt;The best way i find to get this (a way that i've made in many of my devs except Arcgis's) is to use the year value plus 'pop' to get the right field, that usually work but in Arcgis, it seems that the fields aren't loaded until i hard-code the key&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 08:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/forcing-a-feature-value-to-load/m-p/1390222#M57824</guid>
      <dc:creator>N0MAD</dc:creator>
      <dc:date>2024-03-04T08:30:15Z</dc:date>
    </item>
  </channel>
</rss>

