<?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 Popup Opening overrides the definition expression of feature layer (used for filtering locations) in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-opening-overrides-the-definition-expression/m-p/1656168#M21070</link>
    <description>&lt;P&gt;I am developing a custom widget in ArcGIS Experience Builder, I have apply the definition expression on a layer to filter the locations on the map(using a webmap from ArcGIS Enterprises portal in my application).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The issue is when I click on the location to view the popup, all locations starts displaying on map and this (#data_s=id%3AdataSource_1-Risk_Database_Master_2_2642%3A100941) has been added in the url.&lt;BR /&gt;&lt;BR /&gt;So, it seems that popups in experience builder is managed through the Data Source. Can anybody help me to resolve this issue. Any documentation or tutorial for the datasource.&lt;BR /&gt;&lt;BR /&gt;OR&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is it possible to disable this behaviour in ArcGIS Experience Builder, and handle the popup display programmatically.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/677423"&gt;@JeffreyThompson2&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/766971"&gt;@Ke_Xu&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/54255"&gt;@ShengdiZhang&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here , how i am applying filter through defination expression on feature layer.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    try {
          // find the layer(risk locations) in the map to alter the definationexpression according to selected tile where clause 
          const layer: any = jimuMapView.view.map.layers.find((layer: any) =&amp;gt; layer?.url === tile.layer);
          if (layer) {
            // Apply query as a definition expression
            layer.definitionExpression = tile.whereClause;
            await layer.refresh();

            // Optional: Zoom to features
            const queryParam = new Query({
              where: tile.whereClause,
              returnGeometry: true,
              // outFields: ['*'],
            });
            const result = await query.executeQueryJSON(tile.layerUrl, queryParam);
            if (result.features.length &amp;gt; 0) {
              await jimuMapView.view.goTo(result.features.map((f) =&amp;gt; f.geometry));
            }
            else {
              await jimuMapView.view.goTo(jimuMapView.view?.map.initialViewProperties?.viewpoint?.targetGeometry);
            }
          } else {
            console.warn(`Layer with URL ${tile.layerUrl} not found in map`);
            console.log('Available layers:', jimuMapView.view.map.layers.toArray());
          }
        } catch (error) {
          console.error('Error applying query to map:', error);
        }&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;/P&gt;</description>
    <pubDate>Wed, 08 Oct 2025 11:04:34 GMT</pubDate>
    <dc:creator>MirzaMuhammadAhsanAli</dc:creator>
    <dc:date>2025-10-08T11:04:34Z</dc:date>
    <item>
      <title>Popup Opening overrides the definition expression of feature layer (used for filtering locations)</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-opening-overrides-the-definition-expression/m-p/1656168#M21070</link>
      <description>&lt;P&gt;I am developing a custom widget in ArcGIS Experience Builder, I have apply the definition expression on a layer to filter the locations on the map(using a webmap from ArcGIS Enterprises portal in my application).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The issue is when I click on the location to view the popup, all locations starts displaying on map and this (#data_s=id%3AdataSource_1-Risk_Database_Master_2_2642%3A100941) has been added in the url.&lt;BR /&gt;&lt;BR /&gt;So, it seems that popups in experience builder is managed through the Data Source. Can anybody help me to resolve this issue. Any documentation or tutorial for the datasource.&lt;BR /&gt;&lt;BR /&gt;OR&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is it possible to disable this behaviour in ArcGIS Experience Builder, and handle the popup display programmatically.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/677423"&gt;@JeffreyThompson2&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/766971"&gt;@Ke_Xu&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/54255"&gt;@ShengdiZhang&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here , how i am applying filter through defination expression on feature layer.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    try {
          // find the layer(risk locations) in the map to alter the definationexpression according to selected tile where clause 
          const layer: any = jimuMapView.view.map.layers.find((layer: any) =&amp;gt; layer?.url === tile.layer);
          if (layer) {
            // Apply query as a definition expression
            layer.definitionExpression = tile.whereClause;
            await layer.refresh();

            // Optional: Zoom to features
            const queryParam = new Query({
              where: tile.whereClause,
              returnGeometry: true,
              // outFields: ['*'],
            });
            const result = await query.executeQueryJSON(tile.layerUrl, queryParam);
            if (result.features.length &amp;gt; 0) {
              await jimuMapView.view.goTo(result.features.map((f) =&amp;gt; f.geometry));
            }
            else {
              await jimuMapView.view.goTo(jimuMapView.view?.map.initialViewProperties?.viewpoint?.targetGeometry);
            }
          } else {
            console.warn(`Layer with URL ${tile.layerUrl} not found in map`);
            console.log('Available layers:', jimuMapView.view.map.layers.toArray());
          }
        } catch (error) {
          console.error('Error applying query to map:', error);
        }&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 11:04:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-opening-overrides-the-definition-expression/m-p/1656168#M21070</guid>
      <dc:creator>MirzaMuhammadAhsanAli</dc:creator>
      <dc:date>2025-10-08T11:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Popup Opening overrides the definition expression of feature layer (used for filtering locations)</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-opening-overrides-the-definition-expression/m-p/1656222#M21073</link>
      <description>&lt;P&gt;I am currently working on a Custom Filter Widget and also discovered that definitionExpressions don't really work. You will need to create your filter at the dataSource level. Here is the official example:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-experience-builder-sdk-resources/tree/master/widgets/filter-feature-layer" target="_blank"&gt;https://github.com/Esri/arcgis-experience-builder-sdk-resources/tree/master/widgets/filter-feature-layer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And this is the most important block of code.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// First get the DataSourceManager instance
const dsManager = DataSourceManager.getInstance();

// Get the data source using useDataSource.dataSourceId
const useDataSource = props.useDataSources[0];
const ds: FeatureLayerDataSource = dsManager.getDataSource(useDataSource.dataSourceId) as FeatureLayerDataSource;

// Build the queryParams, with the configured filterField and the value
// that has been typed into the TextInput by the user
const queryParams: SqlQueryParams = {
  where: `${props.config.filterField} LIKE '%${evt.target.value}%'`
};

// Filter the data source using updateQueryParams function.
ds.updateQueryParams(queryParams, props.id);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Oct 2025 14:18:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/popup-opening-overrides-the-definition-expression/m-p/1656222#M21073</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2025-10-08T14:18:49Z</dc:date>
    </item>
  </channel>
</rss>

