<?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 Create a hosted feature layer and show objectID by default. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-hosted-feature-layer-and-show-objectid-by/m-p/1321454#M82065</link>
    <description>&lt;P&gt;I want to create a hosted feature layer or update an existing one to show the objectID by default when viewing fields data.&lt;/P&gt;&lt;P&gt;I am confused because on the updateDefinition page on sample 11 there is an attribute called "visible" in the updated field;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/online/update-definition-feature-layer-.htm" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/services-reference/online/update-definition-feature-layer-.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is my updateDefinition I am using (based on the sample #11 above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "fields": [
    {
      "name": "objectid",
      "alias": "fID 1234567890",     
      "visible": true
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get a success when I test this using Insomnia (like postman) but the data does not update with a visible attribute when I test with the following url&lt;/P&gt;&lt;P&gt;&lt;A href="https://server.com/server/rest/services/Hosted/vms_1089_VMSData/FeatureServer/7?f=json&amp;amp;token=...token..." target="_blank" rel="noopener"&gt;https://server.com/server/rest/services/Hosted/vms_1089_VMSData/FeatureServer/7?f=json&amp;amp;token=...token...&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisCrowe1_0-1692746982967.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78872i347D208155E81291/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisCrowe1_0-1692746982967.png" alt="ChrisCrowe1_0-1692746982967.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also seen reference to using the popupFields to control visibility.&amp;nbsp; Is this process documented?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2023 23:32:39 GMT</pubDate>
    <dc:creator>ChrisCrowe1</dc:creator>
    <dc:date>2023-08-22T23:32:39Z</dc:date>
    <item>
      <title>Create a hosted feature layer and show objectID by default.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-hosted-feature-layer-and-show-objectid-by/m-p/1321454#M82065</link>
      <description>&lt;P&gt;I want to create a hosted feature layer or update an existing one to show the objectID by default when viewing fields data.&lt;/P&gt;&lt;P&gt;I am confused because on the updateDefinition page on sample 11 there is an attribute called "visible" in the updated field;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/online/update-definition-feature-layer-.htm" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/services-reference/online/update-definition-feature-layer-.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is my updateDefinition I am using (based on the sample #11 above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "fields": [
    {
      "name": "objectid",
      "alias": "fID 1234567890",     
      "visible": true
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get a success when I test this using Insomnia (like postman) but the data does not update with a visible attribute when I test with the following url&lt;/P&gt;&lt;P&gt;&lt;A href="https://server.com/server/rest/services/Hosted/vms_1089_VMSData/FeatureServer/7?f=json&amp;amp;token=...token..." target="_blank" rel="noopener"&gt;https://server.com/server/rest/services/Hosted/vms_1089_VMSData/FeatureServer/7?f=json&amp;amp;token=...token...&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChrisCrowe1_0-1692746982967.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/78872i347D208155E81291/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChrisCrowe1_0-1692746982967.png" alt="ChrisCrowe1_0-1692746982967.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also seen reference to using the popupFields to control visibility.&amp;nbsp; Is this process documented?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 23:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-hosted-feature-layer-and-show-objectid-by/m-p/1321454#M82065</guid>
      <dc:creator>ChrisCrowe1</dc:creator>
      <dc:date>2023-08-22T23:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a hosted feature layer and show objectID by default.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-hosted-feature-layer-and-show-objectid-by/m-p/1321965#M82071</link>
      <description>&lt;P&gt;I think the problem here is that three different things are being considered as if they were the same, or at least closely related...however, they are quite distinct.&lt;/P&gt;&lt;P&gt;1) The visible property for a field on the &lt;A href="https://developers.arcgis.com/rest/services-reference/online/update-definition-feature-layer-.htm" target="_self"&gt;Update Definition&lt;/A&gt; operation determines whether or not the field (and its data) is exposed to the service.&amp;nbsp; If the value is set to false, then information for that field will not be returned in a request for service information, nor will it be included in a query response.&amp;nbsp; To the end user, it will be as if the field doesn't exist at all.&lt;/P&gt;&lt;P&gt;2) The &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html" target="_self"&gt;Field&lt;/A&gt; object within the SDK does not have a visible property, because it would have no meaning.&amp;nbsp; As far as a layer at runtime within the SDK is concerned, either a field exists or it doesn't.&amp;nbsp; It if exists, the information about it will be in the response sent by the server when the object requests information about the layer (e.g. as seen in the image you posted).&amp;nbsp; Otherwise, no information is provided to the client about fields that, in essence, don't exist.&lt;/P&gt;&lt;P&gt;3) Whether or not a field and its information is visible in the Popup when you click on a feature is determined by how the layer's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html" target="_self"&gt;PopupTemplate&lt;/A&gt; is setup.&amp;nbsp; Setting up a PopupTemplate is a very broad topic, but it gives you full control over what is displayed and what isn't.&amp;nbsp; For example, the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos" target="_self"&gt;fieldInfos&lt;/A&gt; property allows you to specify information about the fields via &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html" target="_self"&gt;FieldInfo&lt;/A&gt; objects.&amp;nbsp; These FieldInfo objects have a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-FieldInfo.html#visible" target="_self"&gt;visible&lt;/A&gt; property that would allow you to control whether the field is displayed or not.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 23:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-a-hosted-feature-layer-and-show-objectid-by/m-p/1321965#M82071</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-08-23T23:31:51Z</dc:date>
    </item>
  </channel>
</rss>

