<?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: Arcade Centroid function doesn't work with Web AppBuilder application in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038787#M20492</link>
    <description>&lt;P&gt;It seems that way, unfortunately. I can't even get it to return &lt;STRONG&gt;Centroid($feature).x&lt;/STRONG&gt; in the attribute table, so that's pretty clear it's the centroid function in particular.&lt;/P&gt;&lt;P&gt;Where does the data originate? Any chance you could use an attribute rule to populate a new field?&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 18:37:41 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-03-19T18:37:41Z</dc:date>
    <item>
      <title>Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038744#M20484</link>
      <description>&lt;P&gt;With ArcGIS Enterprise 10.7.1, have a web map with a polygon layer, and an App created using the Web AppBuilder with that web map. The polygon layer has a custom attribute defined with following Arcade code. When open attributes table in the App, that polygon layer can't show attributes but got stuck.&lt;/P&gt;&lt;P&gt;//&lt;BR /&gt;function MetersToLatLon(mx, my) {&lt;BR /&gt;var originShift = 2.0 * PI * 6378137.0 / 2.0;&lt;/P&gt;&lt;P&gt;var lon = (mx / originShift) * 180.0;&lt;BR /&gt;var lat = (my / originShift) * 180.0;&lt;/P&gt;&lt;P&gt;lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);&lt;BR /&gt;return [lat, lon];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var pnt_centr = Centroid($feature);&lt;BR /&gt;var latlon = MetersToLatLon(pnt_centr.x, pnt_centr.y);&lt;BR /&gt;var result = Round(latlon[0], 6) + "," + Round(latlon[1], 6);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var surveyUrl="&lt;A href="https://survey123.arcgis.app/?itemID=*****+&amp;quot;&amp;amp;center=&amp;quot;+result" target="_blank" rel="noopener"&gt;https://survey123.arcgis.app/?itemID=*****"+"&amp;amp;center="+result&lt;/A&gt;;&lt;BR /&gt;return surveyUrl;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:43:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038744#M20484</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2021-03-19T17:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038748#M20485</link>
      <description>&lt;P&gt;Does the expression evaluate correctly when you test it in the Expression Builder?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:37:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038748#M20485</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-19T17:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038753#M20486</link>
      <description>&lt;P&gt;The quotes aren't correct when you set the URL&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var surveyUrl="https://survey123.arcgis.app/?itemID=*****+&amp;amp;center="+result;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038753#M20486</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-03-19T17:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038757#M20487</link>
      <description>&lt;P&gt;Thanks for the reply. ArcGIS Enterprise 10.7.1 doesn't have built-in Expression Builder, so we didn't test that. But with Field Maps app and map viewer, that link works.&lt;/P&gt;&lt;P&gt;When use web map expression editor to test that link, it also works well.&lt;/P&gt;&lt;P&gt;The surveyUrl is&amp;nbsp;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A href="https://survey123.arcgis.app/?itemID=*****+%22&amp;amp;center=%22+result" target="_blank" rel="noopener nofollow noreferrer"&gt;https://survey123.arcgis.app/?itemID=*****"+"&amp;amp;center="+result.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I used ** to replace the real item id.&lt;/P&gt;&lt;P&gt;For Web AppBuilder App, it just doesn't show any record for that layer in the attributes table.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:50:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038757#M20487</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2021-03-19T17:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038762#M20488</link>
      <description>&lt;P&gt;I used the Arcade playground to test your code and that original line was flagged as error, but somehow my copy and paste dropped a quote. It does return a value for the centroid.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arcade.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8958iAFE47CA40EDE013A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arcade.png" alt="arcade.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038762#M20488</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-03-19T17:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038776#M20490</link>
      <description>&lt;P&gt;Maybe it doesn't have an official name or anything, I just mean the screen where you're writing the expression.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1616176171822.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8957i02C8B317D261BF98/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1616176171822.png" alt="jcarlson_0-1616176171822.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But if it's working in Field Maps, then it may be an issue specific to WAB. Using your same expression, I get this in a web map:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1616176889377.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8959i38F8CDA8AD27A2CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1616176889377.png" alt="jcarlson_1-1616176889377.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when I go to open the Attribute Table widget in WAB, it hangs, just as you're experiencing. Interestingly, I see the same issue even in the Map Viewer's attribute table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_2-1616177036879.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8960i6EE30F0112444D1F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_2-1616177036879.png" alt="jcarlson_2-1616177036879.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't think there's anything wrong with your code, but something about the expression and how the table is trying to interpret it. It may be a bug, or perhaps a limitation of some sort. I've tested a few alternate methods, but cannot get the lat/lon values to populate the table.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 18:14:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038776#M20490</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-19T18:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038782#M20491</link>
      <description>&lt;P&gt;Thanks for all the help.&lt;/P&gt;&lt;P&gt;Actually the popup works, so means the code is correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just the attributes table hangs and can't show any records.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We once used geoprocessing tool and generated lat/long into two columns. In that case the attributes table can show records, but now it can't with the Arcade to generate lat/long.&lt;/P&gt;&lt;P&gt;So I think it is a bug that the Arcade Centroid function doesn't work well with WAB application's attributes table widget.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ming_0-1616178084184.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8964i3C8DFA8ABE8B0FAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ming_0-1616178084184.png" alt="Ming_0-1616178084184.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 18:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038782#M20491</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2021-03-19T18:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038787#M20492</link>
      <description>&lt;P&gt;It seems that way, unfortunately. I can't even get it to return &lt;STRONG&gt;Centroid($feature).x&lt;/STRONG&gt; in the attribute table, so that's pretty clear it's the centroid function in particular.&lt;/P&gt;&lt;P&gt;Where does the data originate? Any chance you could use an attribute rule to populate a new field?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 18:37:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038787#M20492</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-19T18:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Centroid function doesn't work with Web AppBuilder application</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038881#M20493</link>
      <description>&lt;P&gt;That link attribute with centroid function is used for popup, not necessary to display in attribute table, so the workaround is:&lt;/P&gt;&lt;P&gt;1. Configure Attributes Table widget.&lt;/P&gt;&lt;P&gt;2. Select the layer, configure Fields, and uncheck that field.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 21:44:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/arcade-centroid-function-doesn-t-work-with-web/m-p/1038881#M20493</guid>
      <dc:creator>Ming</dc:creator>
      <dc:date>2021-03-19T21:44:07Z</dc:date>
    </item>
  </channel>
</rss>

