<?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: Inaccessible Attributes in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1389425#M83813</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Following tests and verifications, I realized that I should share with you the part of the code that handles the click. Upon closer analysis, I found that I only have access to the attribute that manages the graphical semiotics "Name_en."&lt;/P&gt;&lt;P&gt;Therefore, I believe I can recreate my map using the graphical semiotics based on the "Name" attribute, which contains both the name in English and Arabic, instead of the "Name_en" attribute that only contains the name in English. This resolves my issue.&lt;/P&gt;&lt;P&gt;However, I am facing difficulties understanding the behavior of my code. Rather than completely redoing the map, I would like to seek your expertise in solving this problem.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Manage map click
view.on("click", async function (event) {
    highlight &amp;amp;&amp;amp; highlight.remove();

    const response = await view.hitTest(event);
	console.log("response", response);
    results = response.results;
	console.log("results", results);
    results.pop();
    const result_0 = results[0];

    if (result_0) {
		console.log("Attributes:", result_0.graphic.attributes);
        handleMapClick(result_0);
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2024 14:10:15 GMT</pubDate>
    <dc:creator>Med-Karim-Rouissi</dc:creator>
    <dc:date>2024-03-01T14:10:15Z</dc:date>
    <item>
      <title>Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1385239#M83707</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Hello everybody&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;I am using the ArcGIS API for JavaScript version 4.24. I have created an HGIS (Historical Geographic Information System) application for the tribes of Arabia. My map consists of multiple genealogically layered overlays. When I click on a territory of a tribe, I can retrieve a list of successive parent tribes to which it belongs in the form of clickable buttons, and this works perfectly.&lt;/P&gt;&lt;P&gt;On the buttons for the parent tribes, I intended to display the "Name" attribute, which is in English and Arabic. It displayed correctly with test data, but after publishing my data to ArcGIS Online, I am unable to access all my attributes. The console log only provides the ID and the "Name_en" attribute. However, using the 'PopupTemplate' I can retrieve all attributes.&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Below is a snippet of my code, along with screenshots showing the list display with the "Name_en" attribute and the empty list display when I use the "Name" attribute&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="forum_esri.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95438iC8298D56A1829F25/image-size/large?v=v2&amp;amp;px=999" role="button" title="forum_esri.png" alt="forum_esri.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let poptemp;

// Create PopupTemplate for displaying information
poptemp = new PopupTemplate({
    title: "{Name}",
    content: [{
        type: "fields",
        fieldInfos: [{
            fieldName: "Name_ar",
            label: "Name_ar"
        }, {
            fieldName: "Name_en",
            label: "Name_en"
        }, {
            fieldName: "Wiki_ar_link",
            label: "Wiki_ar_link"
        }, {
            fieldName: "Wiki_en_link",
            label: "Wiki_en_link"
        }]
    }]
});

let Mygraphic = new Graphic({
    popupTemplate: poptemp
});

const Mycontainer = document.getElementById("gridDiv");
Mycontainer.innerHTML = "";

const listNode = document.getElementById("new_graphic");

let feature_1 = new Feature({
    graphic: Mygraphic,
    view: view,
    container: Mycontainer
});

let highlight;

let results;
let result;

// Event handler for list item clicks
function onListClickHandler(event) {
    const target = event.target;
    const resultId = target.getAttribute("data-result-id");
    result = resultId &amp;amp;&amp;amp; results &amp;amp;&amp;amp; results[parseInt(resultId, 10)];

    view.whenLayerView(result.graphic.layer).then(function (layerView) {
        if (result &amp;amp;&amp;amp; results.length &amp;gt; 0) {
            highlight &amp;amp;&amp;amp; highlight.remove();

            view
                .goTo(result.graphic.geometry.extent.expand(1))
                .then(function () {
                    result.graphic.layer.popupTemplate = poptemp;
                    feature_1.graphic = result.graphic;
                    highlight = layerView.highlight(result.graphic);
                    handleClick(result);
                });
        } else {
            feature_1.graphic = graphic;
        }
    });
};

// Function to update the displayed list
function updateList(results) {
    const fragment = document.createDocumentFragment();
    results = results.reverse();

    results.forEach(function (result, index) {
        const attributes = result.graphic.attributes;
        const li = document.createElement("li");
        li.classList.add("panel-result");
        li.tabIndex = index;
        li.setAttribute("data-result-id", index);
        li.textContent = attributes.Name;

        fragment.appendChild(li);
    });

    listNode.innerHTML = "";
    listNode.appendChild(fragment);
    listNode.style.display = "block";
    listNode.addEventListener("click", onListClickHandler);
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Thank you in advance for your help.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Karim&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 03:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1385239#M83707</guid>
      <dc:creator>Med-Karim-Rouissi</dc:creator>
      <dc:date>2024-02-22T03:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1385387#M83709</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Screenshots showing the functionality of the application&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95479i7C80997E1F6572FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95480i117B75C5FC18330F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95481i2654F42575132BB6/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="4.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95482i8692C50640CE730C/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.png" alt="4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 13:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1385387#M83709</guid>
      <dc:creator>Med-Karim-Rouissi</dc:creator>
      <dc:date>2024-02-22T13:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386348#M83735</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/438851"&gt;@Med-Karim-Rouissi&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;Does the layer have the Name field included in the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields" target="_self"&gt;outFields&lt;/A&gt;&amp;nbsp;property? You may need to make sure the layer has those needed attributes when you create it. Setting those fields in the popup template content does not automatically include those attributes for each feature in the layer.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 22:18:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386348#M83735</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2024-02-23T22:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386355#M83737</link>
      <description>&lt;P&gt;Hello LaurenBoyd,&lt;BR /&gt;Indeed the "outFields" are configured:&lt;BR /&gt;outFields: ["*"]&lt;BR /&gt;I also tried indicating them one by one, it doesn't change anything!&lt;BR /&gt;What intrigues me is that I could get the "Name" attribute on the buttons, when I was working on my project a few months ago, and with console.log I could see all my attributes, but not anymore. Is there a bug on Arcgis Online?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  require([
    "esri/Map",
    "esri/Basemap",
    "esri/views/MapView",	
    "esri/layers/FeatureLayer",
    "esri/layers/Layer",
	"esri/geometry/Extent",
    "esri/widgets/Legend",
    "esri/widgets/LayerList",
    "esri/widgets/Expand",
    "esri/widgets/Feature",
    "esri/Graphic",
	"esri/layers/GraphicsLayer",
	"esri/widgets/Home",
    "esri/PopupTemplate",
    "esri/widgets/ScaleBar",
	"esri/geometry/Point",
    "esri/symbols/SimpleMarkerSymbol",
    "esri/Color",
    "dojo/parser",
	"dojo/text!./data/tree.nwk",
    "dojo/domReady!"

  ], function (
    Map,
    Basemap,
    MapView,
    FeatureLayer,
    Layer,
	Extent,
    Legend,
    LayerList,
    Expand,
    Feature,
    Graphic,
	GraphicsLayer,
	Home,
    PopupTemplate,
    ScaleBar,
	Point,
	SimpleMarkerSymbol,
	Color,
	parser,
	newickSource
  ) {
    Layer.fromPortalItem({
      portalItem: {
        id: "a3fc6bbaaec642ce81e46711e08df208"
      },
      outFields: ["*"],
	  visible: true
    }).then(function (groupLayer) {
      const basemap = new Basemap({
        portalItem: {
          id: "00c8181753cd4673810a1ede1f52a922"
        }
      });

      const map = new Map({
        basemap: basemap,
        layers: groupLayer
      });
	  
      let mainExtent = new Extent({
        xmin: 30,
        ymin: 16,
        xmax: 60,
        ymax: 36,
        spatialReference: {
          wkid: 4326
        }
     });	  
   
      const view = new MapView({
        container: "viewDiv",
        map: map,
        center: [45.0, 26.0],
	    zoom: 4,
        popup: {
          highlightEnabled: false,
          autoOpenEnabled: false
        }
      });
      
	  const legend = new Legend({ view: view });
      const legendExpand = new Expand({
        expandTooltip: "Show Legend",
        expanded: false,
        view: view,
        content: legend
      });
      const layerList = new LayerList({ view: view });
      const scaleBar = new ScaleBar({ view: view, unit: "dual" });
	  const homeWidget = new Home({view: view});
  
      view.ui.add(layerList, "top-right");
      view.ui.add(legendExpand, "top-right");
      view.ui.add(scaleBar, { position: "bottom-left" });
	  view.ui.add(homeWidget, "top-left");
	  view.ui.add("logoDiv", "bottom-right");
	  
	  // Récupérer le bouton
       const toggleButton = document.getElementById("logoDiv");
      // Ajouter un gestionnaire d'événements pour le clic sur le bouton
       toggleButton.addEventListener("click", toggleLines);&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Feb 2024 22:38:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386355#M83737</guid>
      <dc:creator>Med-Karim-Rouissi</dc:creator>
      <dc:date>2024-02-23T22:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386400#M83738</link>
      <description>&lt;P&gt;All layers in my project have the same attributes, here is an example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="data.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/95736i5FB39CFD6A8348EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="data.png" alt="data.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2024 00:16:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386400#M83738</guid>
      <dc:creator>Med-Karim-Rouissi</dc:creator>
      <dc:date>2024-02-24T00:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386403#M83739</link>
      <description>&lt;P&gt;I think the issue might be that the outFields are being passed as a parameter into the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem" target="_self"&gt;Layer.fromPortalItem&lt;/A&gt; method - this method only takes a portalItem as an option. Can you try setting the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields" target="_self"&gt;outFields&lt;/A&gt; property on the layer returned from the promise of that method between line 52 and 53 like this?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Layer.fromPortalItem({
  portalItem: {
    id: "cfeb916a04a841e093786e3195a69231"
  }
}).then((layer) =&amp;gt; {
  layer.outFields = ['*'];
  ...
});&lt;/LI-CODE&gt;&lt;P&gt;Here's a smaller example app that does this and prints out the attributes of the clicked feature in the console:&amp;nbsp;&lt;A href="https://codepen.io/laurenb14/pen/zYbVPdm?editors=1000" target="_blank"&gt;https://codepen.io/laurenb14/pen/zYbVPdm?editors=1000&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2024 00:38:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386403#M83739</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2024-02-24T00:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386421#M83741</link>
      <description>&lt;P&gt;I tried this code, it didn't change anything, I don't always see my attributes, and writing "layer" instead of "Layer" gives me an error in the console "&lt;EM&gt;Uncaught (in promise) ReferenceError: layer is not defined&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    Layer.fromPortalItem({
      portalItem: {
        id: "a3fc6bbaaec642ce81e46711e08df208"
      }
    //    outFields: ["*"],
	//    visible: true
    }).then(function (groupLayer) {
	  Layer.outFields = ['*'];
      const basemap = new Basemap({
        portalItem: {
          id: "00c8181753cd4673810a1ede1f52a922"
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried with "groupLayer", nothing changes either&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    Layer.fromPortalItem({
      portalItem: {
        id: "a3fc6bbaaec642ce81e46711e08df208"
      }
    //    outFields: ["*"],
	//    visible: true
    }).then(function (groupLayer) {
      groupLayer.outFields = ['*'];
      const basemap = new Basemap({
        portalItem: {
          id: "00c8181753cd4673810a1ede1f52a922"
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2024 02:40:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1386421#M83741</guid>
      <dc:creator>Med-Karim-Rouissi</dc:creator>
      <dc:date>2024-02-24T02:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Inaccessible Attributes</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1389425#M83813</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Following tests and verifications, I realized that I should share with you the part of the code that handles the click. Upon closer analysis, I found that I only have access to the attribute that manages the graphical semiotics "Name_en."&lt;/P&gt;&lt;P&gt;Therefore, I believe I can recreate my map using the graphical semiotics based on the "Name" attribute, which contains both the name in English and Arabic, instead of the "Name_en" attribute that only contains the name in English. This resolves my issue.&lt;/P&gt;&lt;P&gt;However, I am facing difficulties understanding the behavior of my code. Rather than completely redoing the map, I would like to seek your expertise in solving this problem.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Manage map click
view.on("click", async function (event) {
    highlight &amp;amp;&amp;amp; highlight.remove();

    const response = await view.hitTest(event);
	console.log("response", response);
    results = response.results;
	console.log("results", results);
    results.pop();
    const result_0 = results[0];

    if (result_0) {
		console.log("Attributes:", result_0.graphic.attributes);
        handleMapClick(result_0);
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 14:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/inaccessible-attributes/m-p/1389425#M83813</guid>
      <dc:creator>Med-Karim-Rouissi</dc:creator>
      <dc:date>2024-03-01T14:10:15Z</dc:date>
    </item>
  </channel>
</rss>

