<?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: Need to replace value for the attribute (using domains and don't want to see domain value) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-to-replace-value-for-the-attribute-using/m-p/1158111#M76806</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/344229"&gt;@lxd&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your question it is not clear what framework you are using to develop this code.&lt;/P&gt;&lt;P&gt;However, I assume you are using WebAppBuilder and looks like you are creating date for the Report dijit in jimu core to print the report.&lt;/P&gt;&lt;P&gt;If you are using Web App Builder you can use jimuUtils method to get the values for domain like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// this.featureLayer is the layer which is used for querying
// fieldName which has coded domain
// attributes - Attributes object of the fetched feature
var layerDefinition = jimuUtils.getFeatureLayerDefinition(this.featureLayer);
var result = jimuUtils.getDisplayValueForCodedValueOrSubtype(layerDefinition,fieldName,attributes);
//In result.displayValue you willl get the displayValue for the code
result.displayValue;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And to add a new row in the data to print sum you can push one row in your dataReport var like this:&lt;/P&gt;&lt;P&gt;dataReport2.push(["",totalSum,""])&lt;/P&gt;</description>
    <pubDate>Sat, 26 Mar 2022 10:38:51 GMT</pubDate>
    <dc:creator>SumitZarkarCT</dc:creator>
    <dc:date>2022-03-26T10:38:51Z</dc:date>
    <item>
      <title>Need to replace value for the attribute (using domains and don't want to see domain value)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-to-replace-value-for-the-attribute-using/m-p/1157647#M76777</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not a developer and find it hard to work this out.&lt;/P&gt;&lt;P&gt;I have this code:&lt;/P&gt;&lt;P&gt;queryTask.execute(query, lang.hitch(this, function(results) {&lt;BR /&gt;DataReport = array.map(results.features, function (feature) {&lt;BR /&gt;Data= [feature.attributes["PLANNEDORCOMPLETED"],feature.attributes["AREAHA"],feature.attributes["ACTIVITYTYPE"],];&lt;BR /&gt;dataReport2.push(Data);&lt;BR /&gt;});&lt;BR /&gt;}));&lt;/P&gt;&lt;P&gt;feature.attributes["PLANNEDORCOMPLETED"] - is a field with coded domain, so my output looks like 1,2,3,1,2,3 (these are the values of the domain, see screenshot below). I can't work out how to replace numbers with actual descriptive values of the domain names.&lt;/P&gt;&lt;P&gt;I am not necessary need to connect back to the dataset, even if I can add somewhere in my code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;if 1, use "tomato, if 2, use "potato", etc. Not sure how and where...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also would like to add an extra row at the end to populate the sum of all numbers. I got the value for the sum but don't know how to add extra line in the Data variable.&lt;/P&gt;&lt;P&gt;Any help greatly appreciated!&amp;nbsp;&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-inline" image-alt="screen1.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37321i28211D0EFD3808FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="screen1.png" alt="screen1.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-inline" image-alt="screen2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37322i93B32558305050AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="screen2.png" alt="screen2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 01:34:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-to-replace-value-for-the-attribute-using/m-p/1157647#M76777</guid>
      <dc:creator>lxd</dc:creator>
      <dc:date>2022-03-25T01:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace value for the attribute (using domains and don't want to see domain value)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-to-replace-value-for-the-attribute-using/m-p/1158111#M76806</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/344229"&gt;@lxd&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your question it is not clear what framework you are using to develop this code.&lt;/P&gt;&lt;P&gt;However, I assume you are using WebAppBuilder and looks like you are creating date for the Report dijit in jimu core to print the report.&lt;/P&gt;&lt;P&gt;If you are using Web App Builder you can use jimuUtils method to get the values for domain like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// this.featureLayer is the layer which is used for querying
// fieldName which has coded domain
// attributes - Attributes object of the fetched feature
var layerDefinition = jimuUtils.getFeatureLayerDefinition(this.featureLayer);
var result = jimuUtils.getDisplayValueForCodedValueOrSubtype(layerDefinition,fieldName,attributes);
//In result.displayValue you willl get the displayValue for the code
result.displayValue;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And to add a new row in the data to print sum you can push one row in your dataReport var like this:&lt;/P&gt;&lt;P&gt;dataReport2.push(["",totalSum,""])&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 10:38:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-to-replace-value-for-the-attribute-using/m-p/1158111#M76806</guid>
      <dc:creator>SumitZarkarCT</dc:creator>
      <dc:date>2022-03-26T10:38:51Z</dc:date>
    </item>
  </channel>
</rss>

