<?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: Format info window content: Display text from a Double field in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476299#M44249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chang-Heng,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here is an example function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function setContent(value)&amp;nbsp; {
&amp;nbsp; var formatString = "&amp;lt;b&amp;gt;Property Name:&amp;nbsp; &amp;lt;/b&amp;gt; + value.attributes.PropertyName +"&amp;lt;br/&amp;gt;"
&amp;nbsp; var sqft = geometryEngine.geodesicArea(value.geometry, "square-feet");
&amp;nbsp; var squarefeet = number.format(sqft, { places: 1 });
&amp;nbsp; var acres = number.format(sqft / 43560, { places: 0 });
&amp;nbsp; formatString += "Acres:&amp;nbsp; " + acres;
&amp;nbsp; return formatString;
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:03:32 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-11T21:03:32Z</dc:date>
    <item>
      <title>Format info window content: Display text from a Double field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476296#M44246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Thank you for your time in advance.&amp;nbsp; I am wondering if anyone could provide valuable opinions how to display the text from a Double field in the info window (code listed below). I found some records have the zero value in the Double field ${WellDepth}. I want to see if anyone could provide a function to replace the 0 to display "Unknown Value" and keep the same value if the ${WellDepth} is greater than 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Hank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var content_magnesium_depthLocation = 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;b&amp;gt;PointID&amp;lt;/b&amp;gt;: ${POINT_ID}" +
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Date Collection&amp;lt;/b&amp;gt;: ${Collection}" +
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Magnesium Value&amp;lt;/b&amp;gt;: ${Mg_Symbol}${Mg}(mg/L)" +
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Well Depth&amp;lt;/b&amp;gt;: ${WellDepth}(ft)" +
&amp;nbsp;&amp;nbsp; "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Data Source&amp;lt;/b&amp;gt;: ${DataSource}" +
&amp;nbsp; "&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Data Source Information&amp;lt;/b&amp;gt;: ${DataSour_1}" +
"&amp;lt;br&amp;gt;&amp;lt;b &amp;gt;More Information&amp;lt;/b&amp;gt;:&amp;lt;a target='_blank' href='https://community.esri.com/maps/data/Water/${POINT_ID}/Mg' &amp;gt;Magnesium Info&amp;lt;/a&amp;gt;";&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:03:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476296#M44246</guid>
      <dc:creator>Chang-HengYang</dc:creator>
      <dc:date>2021-12-11T21:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Format info window content: Display text from a Double field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476297#M44247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chang-Heng,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This is exactly one of the reasons why the InfoTemplates set setContent method can take a string or a function. Use a function to look at the features attribute value for WellDepth and if it is 0 then add text to the content string that is returned instead of the numeric value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 18:54:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476297#M44247</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-05-16T18:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Format info window content: Display text from a Double field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476298#M44248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;Thank you for the reply. I am wondering if you could provide more details on the function for this question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chang-Heng &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 19:37:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476298#M44248</guid>
      <dc:creator>Chang-HengYang</dc:creator>
      <dc:date>2016-05-16T19:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Format info window content: Display text from a Double field</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476299#M44249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chang-Heng,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here is an example function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function setContent(value)&amp;nbsp; {
&amp;nbsp; var formatString = "&amp;lt;b&amp;gt;Property Name:&amp;nbsp; &amp;lt;/b&amp;gt; + value.attributes.PropertyName +"&amp;lt;br/&amp;gt;"
&amp;nbsp; var sqft = geometryEngine.geodesicArea(value.geometry, "square-feet");
&amp;nbsp; var squarefeet = number.format(sqft, { places: 1 });
&amp;nbsp; var acres = number.format(sqft / 43560, { places: 0 });
&amp;nbsp; formatString += "Acres:&amp;nbsp; " + acres;
&amp;nbsp; return formatString;
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:03:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/format-info-window-content-display-text-from-a/m-p/476299#M44249</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T21:03:32Z</dc:date>
    </item>
  </channel>
</rss>

