<?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: ESRI JS API in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079306#M41223</link>
    <description>&lt;P&gt;Can you post your code using the "Insert code sample" tool instead of in an image?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_blank"&gt;https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jul 2021 16:31:09 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2021-07-15T16:31:09Z</dc:date>
    <item>
      <title>ESRI JS API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079290#M41221</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;function buildPopupContent() {

        var aep = [
            {
                'featureLayer': meanAnnualWaveResourceSelkie,
                'fieldInfos': [
                    {
                        'fieldName': 'Wave_Power',
                    }
                ]
            }
        ];


        console.log("buildPopupContent")

        

        let div = document.createElement("div");

        div.innerHTML =


            '&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;AEP: &amp;lt;td&amp;gt;' + aep + '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;' +
            '&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Project Life: &amp;lt;td&amp;gt;&amp;lt;input type="number" name="defaultProjectLife" id="defaultProjectLife" style="width: 7em" value="20" min=1 max=100/&amp;gt;&amp;lt;span id="defaultProjectLife_errors"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;' +
            '&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Discount Rate: &amp;lt;td&amp;gt;&amp;lt;input type="number" name="defaultDiscountRate" id="defaultDiscountRate" style="width: 7em" value="5" min=1 max=50/&amp;gt;&amp;lt;span id="defaultDiscountRate_errors"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;' + '&amp;lt;BR&amp;gt;' +

            '&amp;lt;div id="calculate_lcoe"&amp;gt;&amp;lt;button onclick="calc_te()"&amp;gt;Calculate&amp;lt;/button&amp;gt;&amp;lt;/div&amp;gt;' + '&amp;lt;BR&amp;gt;' +
            '&amp;lt;button&amp;gt;&amp;lt;/div&amp;gt;' +

            '&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LCOE: &amp;lt;td&amp;gt;&amp;lt;input type="text" name="lcoe" id="lcoe" style="width: 7em" disabled /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;'
        
        return div;

    }
​&lt;/LI-CODE&gt;&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My issue is with trying to include inputs and run calculations from a feature layer with popupTemplate in JS API. The template will accept the attribute input in the title section of the popup but not in the contents section where it is just appearing as '[object Object]'. The image below shows what happens upon activating the popup. I need to call the attribute value from the feature layer into the contents section so that it can be used as another input to the calculation of the LCOE output.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ross_1_0-1626365699362.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/18549iED6970D89C4C59D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ross_1_0-1626365699362.png" alt="Ross_1_0-1626365699362.png" /&gt;&lt;/span&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;Another brief way of describing the issue is that I am unable to pass a feature layer variable into the content builder function. I also attach a snippet of some of the relevant section of code here.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ross_1_1-1626365699363.png" style="width: 783px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/18548iB0EC33453329BC95/image-dimensions/783x449?v=v2" width="783" height="449" role="button" title="Ross_1_1-1626365699363.png" alt="Ross_1_1-1626365699363.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;Ross&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Jul 2021 15:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079290#M41221</guid>
      <dc:creator>Ross_1</dc:creator>
      <dc:date>2021-07-16T15:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI JS API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079306#M41223</link>
      <description>&lt;P&gt;Can you post your code using the "Insert code sample" tool instead of in an image?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_blank"&gt;https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079306#M41223</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-07-15T16:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI JS API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079369#M41226</link>
      <description>&lt;P&gt;Your "aep" variable is an array, not a string value. If you want it to read the field, you can pass aep as "{WavePower}" and it will read the field that way. That syntax is described here.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 18:36:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079369#M41226</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-07-15T18:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI JS API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079693#M41239</link>
      <description>&lt;P&gt;Done!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 15:37:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079693#M41239</guid>
      <dc:creator>Ross_1</dc:creator>
      <dc:date>2021-07-16T15:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI JS API</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079729#M41240</link>
      <description>&lt;P&gt;Hi Rene,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, but unfortunately I have tried that and it does not fix the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ross&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 16:56:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/esri-js-api/m-p/1079729#M41240</guid>
      <dc:creator>Ross_1</dc:creator>
      <dc:date>2021-07-16T16:56:48Z</dc:date>
    </item>
  </channel>
</rss>

