<?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 How to get all feature attributes into Javascript? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-all-feature-attributes-into-javascript/m-p/169433#M15707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How can I all a feature's attributes into Javascript?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When we use {*} to indicate all attributes, the only info template we can use is ${*}, but that doesn't allow us to add any HTML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The end goal is we need to get all a feature's attributes into some kind of string (json is fine) so we can do something with it.&amp;nbsp; In our case we need to persist it elsewhere.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In our page, we don't know which layers a user may select, or what feature they may click on, or even which attributes they'll be interested in.&amp;nbsp; Each layer has unique attributes for its features, so we need to use some kind of wildcard.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;layerMap[layerObject.name] = new FeatureLayer(each, {
&amp;nbsp; mode: FeatureLayer.MODE_SNAPSHOT,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; infoTemplate: new InfoTemplate(layerObject.name, "${*}") 
});&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding anything to the InfoTemplate screws it up.&amp;nbsp; All we'll get is what we added, none of the key-value pairs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Mar 2014 14:00:58 GMT</pubDate>
    <dc:creator>ThomasGagne</dc:creator>
    <dc:date>2014-03-18T14:00:58Z</dc:date>
    <item>
      <title>How to get all feature attributes into Javascript?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-all-feature-attributes-into-javascript/m-p/169433#M15707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How can I all a feature's attributes into Javascript?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When we use {*} to indicate all attributes, the only info template we can use is ${*}, but that doesn't allow us to add any HTML.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The end goal is we need to get all a feature's attributes into some kind of string (json is fine) so we can do something with it.&amp;nbsp; In our case we need to persist it elsewhere.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In our page, we don't know which layers a user may select, or what feature they may click on, or even which attributes they'll be interested in.&amp;nbsp; Each layer has unique attributes for its features, so we need to use some kind of wildcard.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;layerMap[layerObject.name] = new FeatureLayer(each, {
&amp;nbsp; mode: FeatureLayer.MODE_SNAPSHOT,
&amp;nbsp; outFields: ["*"],
&amp;nbsp; infoTemplate: new InfoTemplate(layerObject.name, "${*}") 
});&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding anything to the InfoTemplate screws it up.&amp;nbsp; All we'll get is what we added, none of the key-value pairs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 14:00:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-get-all-feature-attributes-into-javascript/m-p/169433#M15707</guid>
      <dc:creator>ThomasGagne</dc:creator>
      <dc:date>2014-03-18T14:00:58Z</dc:date>
    </item>
  </channel>
</rss>

