<?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: Not all attributes for graphic(s) are returned when querying FeatureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011787#M71170</link>
    <description>&lt;P&gt;You may need to "load" the features.&lt;/P&gt;&lt;P&gt;Similar question asked on other platforms:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-qt/when-calling-queryfeatures-on-a-featuretable-not-all-attributes/td-p/386980" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-qt/when-calling-queryfeatures-on-a-featuretable-not-all-attributes/td-p/386980&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-ios/attributes-results-dosen-t-match-fields-count-in-feature-layer/td-p/506735" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-ios/attributes-results-dosen-t-match-fields-count-in-feature-layer/td-p/506735&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-net/missing-attributes-after-pulling-a-feature-from-feature-service/td-p/355364" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-net/missing-attributes-after-pulling-a-feature-from-feature-service/td-p/355364&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2020 17:25:57 GMT</pubDate>
    <dc:creator>TomBruns</dc:creator>
    <dc:date>2020-12-22T17:25:57Z</dc:date>
    <item>
      <title>Not all attributes for graphic(s) are returned when querying FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011692#M71165</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am creating a FeatureLayer containing Point graphics client-side from data retrieved from my database. This is how that looks like:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const pointLayer = new FeatureLayer({
  id: unitType.unitTypeName.replace(' ', '-'),
  source: pointGraphics,
  fields: layerSchema,
  renderer: {
     type: 'unique-value', // autocasts as new UniqueValueRenderer()
     field: 'unitId',
     uniqueValueInfos: [...infos.values()]
  }
});&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;pointGraphics&lt;/STRONG&gt; is an array of graphics with each graphic defined as follows:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const g = new Graphic({
   geometry: {
      type: 'point', // autocasts as new Point()
      longitude: unit.point.geometry.coordinates[0],
      latitude: unit.point.geometry.coordinates[1]
   },
   attributes: {
      OBJECTID: objectCounter,
      unitId: unit.unitId,
      areaId: unit.assignment.areaId,
      areaColor: unit.assignment.config.color
   }
});&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;layersSchema&lt;/STRONG&gt; which represents the fields is defined like so:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const layerSchema = [{
       name: 'OBJECTID',
       type: 'oid'
   }, {
       name: 'unitId',
       type: 'string'
   }, {
       name: 'areaId',
       type: 'string'
   }, {
       name: 'areaColor',
       type: 'string'
   }
];&lt;/LI-CODE&gt;&lt;P&gt;and lastly,&amp;nbsp;infos is defined as a Map from which the values() is extracted for the &lt;STRONG&gt;uniqueValuesInfos&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;infos.set(unit.unitId, {
   value: unit.unitId,
   symbol: {
      type: 'simple-marker',
      color: unit.assignment.config.color,
      outline: { // autocasts as new SimpleLineSymbol()
          color: 'grey',
          width: 0.5
      },
      style: overlay.pointStyle.toLowerCase(),
      size: overlay.pointSize
   }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The layer renders correctly with each graphic representing a unit, colored correctly based on the unit's assignment.&lt;/P&gt;&lt;P&gt;I query the layer using a graphic . The query is defined like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// create a query and set its geometry parameter to the
// polygon that was drawn on the view
const query = {
   geometry: graphic.geometry,
   spatialRelationship: 'contains',
   outFields: ['*']
};&lt;/LI-CODE&gt;&lt;P&gt;I then highlight the selected feature(s) like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;viewLayer.queryFeatures(query)
   .then((results) =&amp;gt; {
        graphics = graphics.concat(results.features);
        if (graphics.length &amp;gt; 0) {
            // highlight query results
            this.highlight.push(viewLayer.highlight(graphics));
        }
});&lt;/LI-CODE&gt;&lt;P&gt;The selected features highlights correctly as expected&lt;/P&gt;&lt;P&gt;When I look at the attribute property of any of the graphics return from the query, it only show the '&lt;STRONG&gt;OBJECTID&lt;/STRONG&gt;' and the '&lt;STRONG&gt;unitId&lt;/STRONG&gt;' attributes, and not all the attributes as defined above.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is this expected behavior?&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;What do I need to define differently to be able to see ALL attributes when query returns?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Right now, I have to use the 'OBJECTID' and the perform another find operation on the associated layer's source to retrieve all the other attributes&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 12:54:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011692#M71165</guid>
      <dc:creator>Namibian</dc:creator>
      <dc:date>2020-12-22T12:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Not all attributes for graphic(s) are returned when querying FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011787#M71170</link>
      <description>&lt;P&gt;You may need to "load" the features.&lt;/P&gt;&lt;P&gt;Similar question asked on other platforms:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-qt/when-calling-queryfeatures-on-a-featuretable-not-all-attributes/td-p/386980" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-qt/when-calling-queryfeatures-on-a-featuretable-not-all-attributes/td-p/386980&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-ios/attributes-results-dosen-t-match-fields-count-in-feature-layer/td-p/506735" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-ios/attributes-results-dosen-t-match-fields-count-in-feature-layer/td-p/506735&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-net/missing-attributes-after-pulling-a-feature-from-feature-service/td-p/355364" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdk-for-net/missing-attributes-after-pulling-a-feature-from-feature-service/td-p/355364&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 17:25:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011787#M71170</guid>
      <dc:creator>TomBruns</dc:creator>
      <dc:date>2020-12-22T17:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Not all attributes for graphic(s) are returned when querying FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011803#M71173</link>
      <description>&lt;P&gt;Not sure without a codepen/jsbin/other, but you might try setting the 'outFields' parameter of the layer (or maybe the Query) to an &lt;EM&gt;explicit&lt;/EM&gt; list of field names (don't use "*").&amp;nbsp; If using a FeatureLayerView, check the 'availableFields' parameter before calling queryFeatures(...).&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 17:45:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011803#M71173</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2020-12-22T17:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not all attributes for graphic(s) are returned when querying FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011805#M71174</link>
      <description>Thanks for your response.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Dec 2020 17:47:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011805#M71174</guid>
      <dc:creator>Namibian</dc:creator>
      <dc:date>2020-12-22T17:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Not all attributes for graphic(s) are returned when querying FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011811#M71176</link>
      <description>&lt;P&gt;Setting the outFields to a discrete list did the trick!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 17:59:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/not-all-attributes-for-graphic-s-are-returned-when/m-p/1011811#M71176</guid>
      <dc:creator>Namibian</dc:creator>
      <dc:date>2020-12-22T17:59:51Z</dc:date>
    </item>
  </channel>
</rss>

