<?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 How to get datasource by DataSourceManager in Experience Builder Custom Widgets</title>
    <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-get-datasource-by-datasourcemanager/m-p/1556694#M396</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;May I know how to get layer by datasource id, When I use Datasourcemanager.getInstance().&lt;SPAN&gt;getDataSource(datasourceid). If I input the map datasource id , I can get the web map. but if I choose the featurelayer datasource id I got undefined result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have selected the feature layer in the setting page.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to query like this, but I can't figure it out in any of the documentation&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// layer.queryFeatures(query).then((results) =&amp;gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; if (results.features &amp;amp;&amp;amp; results.features[0]) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; &amp;nbsp; console.log('geofence layers')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; &amp;nbsp; console.log(results.features)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// })&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am using experience builder version 1.15&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 08 Nov 2024 04:07:59 GMT</pubDate>
    <dc:creator>Than_HtetAung</dc:creator>
    <dc:date>2024-11-08T04:07:59Z</dc:date>
    <item>
      <title>How to get datasource by DataSourceManager</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-get-datasource-by-datasourcemanager/m-p/1556694#M396</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;May I know how to get layer by datasource id, When I use Datasourcemanager.getInstance().&lt;SPAN&gt;getDataSource(datasourceid). If I input the map datasource id , I can get the web map. but if I choose the featurelayer datasource id I got undefined result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have selected the feature layer in the setting page.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to query like this, but I can't figure it out in any of the documentation&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// layer.queryFeatures(query).then((results) =&amp;gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; if (results.features &amp;amp;&amp;amp; results.features[0]) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; &amp;nbsp; console.log('geofence layers')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; &amp;nbsp; console.log(results.features)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// })&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am using experience builder version 1.15&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Nov 2024 04:07:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-get-datasource-by-datasourcemanager/m-p/1556694#M396</guid>
      <dc:creator>Than_HtetAung</dc:creator>
      <dc:date>2024-11-08T04:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get datasource by DataSourceManager</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-get-datasource-by-datasourcemanager/m-p/1608309#M551</link>
      <description>&lt;P&gt;Did you ever get this to work? I'm struggling with this too.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 23:23:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/how-to-get-datasource-by-datasourcemanager/m-p/1608309#M551</guid>
      <dc:creator>DanielWebb</dc:creator>
      <dc:date>2025-04-22T23:23:37Z</dc:date>
    </item>
  </channel>
</rss>

