<?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 Passing attribute value as a variable with ArcGIS JavaScript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-attribute-value-as-a-variable-with-arcgis/m-p/243976#M22591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get the value of an attribute when a user clicks on a feature. Building off this example: &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=tasks-identify" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=tasks-identify&lt;/A&gt;. Does anyone know how I can, for example, get the value for DomOrd in the layer Soil Survey Geographic? The following code snippet is from the above example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; if (layerName === 'Soil Survey Geographic') {
//the following two lines are similar to what I want, but they don't work
 var attributeVal = result.layerName.DomOrd;&amp;nbsp;
console.log(attributeVal);
 feature.popupTemplate = { // autocasts as new PopupTemplate()
 title: "{Map Unit Name}",
 content: "&amp;lt;b&amp;gt;Dominant order:&amp;lt;/b&amp;gt; {Dominant Order} ({Dom. Cond. Order %}%)" +
...&lt;/PRE&gt;&lt;P&gt;I need to pass the attribute value in an SQL query with ColdFusion - so that's why I need the value.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/tag/arcgis javascript 4.3/tg-p" target="_blank"&gt;#arcgis javascript 4.3&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:14:36 GMT</pubDate>
    <dc:creator>PattyJula</dc:creator>
    <dc:date>2021-12-12T16:14:36Z</dc:date>
    <item>
      <title>Passing attribute value as a variable with ArcGIS JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-attribute-value-as-a-variable-with-arcgis/m-p/243976#M22591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to get the value of an attribute when a user clicks on a feature. Building off this example: &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=tasks-identify" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=tasks-identify&lt;/A&gt;. Does anyone know how I can, for example, get the value for DomOrd in the layer Soil Survey Geographic? The following code snippet is from the above example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; if (layerName === 'Soil Survey Geographic') {
//the following two lines are similar to what I want, but they don't work
 var attributeVal = result.layerName.DomOrd;&amp;nbsp;
console.log(attributeVal);
 feature.popupTemplate = { // autocasts as new PopupTemplate()
 title: "{Map Unit Name}",
 content: "&amp;lt;b&amp;gt;Dominant order:&amp;lt;/b&amp;gt; {Dominant Order} ({Dom. Cond. Order %}%)" +
...&lt;/PRE&gt;&lt;P&gt;I need to pass the attribute value in an SQL query with ColdFusion - so that's why I need the value.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/tag/arcgis javascript 4.3/tg-p" target="_blank"&gt;#arcgis javascript 4.3&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:14:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-attribute-value-as-a-variable-with-arcgis/m-p/243976#M22591</guid>
      <dc:creator>PattyJula</dc:creator>
      <dc:date>2021-12-12T16:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing attribute value as a variable with ArcGIS JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-attribute-value-as-a-variable-with-arcgis/m-p/243977#M22592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's how to get the value from the field DomOrd. You have to use the field alias to get it&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; attributeVal &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Dominant Order"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍
console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;attributeVal&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:11:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/passing-attribute-value-as-a-variable-with-arcgis/m-p/243977#M22592</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T12:11:21Z</dc:date>
    </item>
  </channel>
</rss>

