<?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: Get X,Y coordinates of data records in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/get-x-y-coordinates-of-data-records/m-p/1112949#M3116</link>
    <description>&lt;P&gt;I've figured out, what caused the issue for me.&lt;/P&gt;&lt;P&gt;I was using the DataSourceComponent with an empty query. Setting returnGeometry in the query solved the problem.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;DataSourceComponent
        useDataSource={props.useDataSources[0]}
        query={{where: '1=1',outFields: ['*'],returnGeometry: true,}}
        widgetId={props.id}
&amp;gt;
        {dataRender}
&amp;lt;/DataSourceComponent&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Nov 2021 19:19:34 GMT</pubDate>
    <dc:creator>Dan_</dc:creator>
    <dc:date>2021-11-01T19:19:34Z</dc:date>
    <item>
      <title>Get X,Y coordinates of data records</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/get-x-y-coordinates-of-data-records/m-p/1108690#M3012</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to read the x &amp;amp; y coordinates of selected data records in a custom widget. My data source is a layer of points. Retrieving the data attributes of the selected records works perfectly fine, but I can't figure out, how to get the points' coordinates. getGeometry() returns null. I'm using the current version (v1.5) of the developer edition. Am I missing something?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const ds = DataSourceManager.getInstance().getDataSource(
  props.useDataSources[0].dataSourceId
);
ds.getSelectedRecords().map((r) =&amp;gt; {
  console.log(r.getGeometry()); // null
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 03:34:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/get-x-y-coordinates-of-data-records/m-p/1108690#M3012</guid>
      <dc:creator>Dan_</dc:creator>
      <dc:date>2021-10-19T03:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get X,Y coordinates of data records</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/get-x-y-coordinates-of-data-records/m-p/1112949#M3116</link>
      <description>&lt;P&gt;I've figured out, what caused the issue for me.&lt;/P&gt;&lt;P&gt;I was using the DataSourceComponent with an empty query. Setting returnGeometry in the query solved the problem.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;DataSourceComponent
        useDataSource={props.useDataSources[0]}
        query={{where: '1=1',outFields: ['*'],returnGeometry: true,}}
        widgetId={props.id}
&amp;gt;
        {dataRender}
&amp;lt;/DataSourceComponent&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/get-x-y-coordinates-of-data-records/m-p/1112949#M3116</guid>
      <dc:creator>Dan_</dc:creator>
      <dc:date>2021-11-01T19:19:34Z</dc:date>
    </item>
  </channel>
</rss>

