<?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: withTable selection selecting wrong row in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/withTable-selection-selecting-wrong-row/m-p/1637092#M3557</link>
    <description>&lt;P&gt;I tried updating to the Visuals API 3.5.1, but I'm still encountering the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried packaging the visual and trying it in Desktop, but still encountering the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An easier way to demonstrate is to duplicate the custom visual on the page. When I select the rows in one custom visual, the same &lt;STRONG&gt;number&lt;/STRONG&gt; of rows is passed to the other custom visual, but not the same rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried investigating at the identityIndex from the selectionId.getKey(), but that seems like it's an index local to the visual itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on what to investigate next?&lt;/P&gt;</description>
    <pubDate>Mon, 01 Feb 2021 23:14:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-02-01T23:14:37Z</dc:date>
    <item>
      <title>withTable selection selecting wrong row</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/withTable-selection-selecting-wrong-row/m-p/1627767#M3547</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I've encountered an issue when using the withTable selection with a map-based custom visual that I'm developing using Leaflet. The wrong row is selected when I create the selection in the custom visual. To demonstrate this, I put the same data passed to the custom visual in a native table visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I click on the table visual, it shows a specific segment in the custom visual:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="select_row.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/441913i7D35A53C6B1BBA56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="select_row.png" alt="select_row.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;But when I click on the segment in the custom visual, it shows a different row in the table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="select_segment.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/441914i8908753E21847491/image-size/medium?v=v2&amp;amp;px=400" role="button" title="select_segment.png" alt="select_segment.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the v2.6.0 of the API. Simplified code is below. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;capabilities.json&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "dataRoles": [
    {
      "displayName": "Geometry (WKT)",
      "kind": "Grouping",
      "name": "geometry"
    },
    {
      "displayName": "Volume Count",
      "kind": "Measure",
      "name": "count"
    },
    {
      "displayName": "Tooltips",
      "kind": "Grouping",
      "name": "tooltips"
    }
  ],
  "dataViewMappings": [
    {
      "table": {
        "rows": {
          "select": [
            { "for": { "in": "geometry" } },
            { "for": { "in": "count" } },
            { "for": { "in": "tooltips" } }
          ]
        }
      }
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;visual.ts&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;public update(options: VisualUpdateOptions) {
  const table = options.dataViews[0].table;
  table.rows.forEach((row, index) =&amp;gt; {
    // Generate line geometry from data
    const line = ...

    // Selection
    const selectionId = this.host.createSelectionIdBuilder()
      .withTable(table, index)
      .createSelectionId();

    const polyline = L.polyline(line)
      .on("click", () =&amp;gt; { this.selectionManager.select(selectionId); })
      .addTo(this.map);
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 03:33:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/withTable-selection-selecting-wrong-row/m-p/1627767#M3547</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-28T03:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: withTable selection selecting wrong row</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/withTable-selection-selecting-wrong-row/m-p/1637092#M3557</link>
      <description>&lt;P&gt;I tried updating to the Visuals API 3.5.1, but I'm still encountering the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried packaging the visual and trying it in Desktop, but still encountering the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An easier way to demonstrate is to duplicate the custom visual on the page. When I select the rows in one custom visual, the same &lt;STRONG&gt;number&lt;/STRONG&gt; of rows is passed to the other custom visual, but not the same rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried investigating at the identityIndex from the selectionId.getKey(), but that seems like it's an index local to the visual itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on what to investigate next?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 23:14:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/withTable-selection-selecting-wrong-row/m-p/1637092#M3557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-01T23:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: withTable selection selecting wrong row</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/withTable-selection-selecting-wrong-row/m-p/1640736#M3560</link>
      <description>&lt;P&gt;I ended up switching to using a Basic Filter from the Visual Filters API instead of Selection and everything worked.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 05:41:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/withTable-selection-selecting-wrong-row/m-p/1640736#M3560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-03T05:41:35Z</dc:date>
    </item>
  </channel>
</rss>

