<?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 Custom Visual - Slicer with 'applyJsonFilter' API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Slicer-with-applyJsonFilter-API/m-p/710305#M19608</link>
    <description>&lt;P&gt;Hello, everyone!&lt;/P&gt;&lt;P&gt;I am building my very first custom visual and need some help in figuring out what went wrong ... I was trying to create a slicer with 'applyJsonFilter' API.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        msd_li.addEventListener("click", event =&amp;gt; {

          let filterText = (event.target as HTMLElement).innerText;
          console.log(filterText);

          let src=this.dataView.categorical.categories[1].source;
          console.log(src.queryName);
          const target = {
            table: src.queryName.substr(0, src.queryName.indexOf(".")),
            column:src.displayName
          };

          console.log("Table: " + target.table + "\nColumn: " + target.column);          

          let filter = new models.AdvancedFilter(target, "And", {
            operator: "Is",
            value: filterText
          });  &lt;BR /&gt;&lt;BR /&gt;          debugger;
          this.host.applyJsonFilter(filter,"general","filter",powerbi.FilterAction.merge); 
        });&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;However, when I clicked on the element I got an error on the last line: Cannot read property 'applyJsonFilter' of undefined. I might have missed some information but wasn't able to figure out which part was wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TypeError.png" style="width: 314px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/169521iEECDD92DC78A90A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="TypeError.png" alt="TypeError.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2019 07:43:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-06-10T07:43:04Z</dc:date>
    <item>
      <title>Custom Visual - Slicer with 'applyJsonFilter' API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Slicer-with-applyJsonFilter-API/m-p/710305#M19608</link>
      <description>&lt;P&gt;Hello, everyone!&lt;/P&gt;&lt;P&gt;I am building my very first custom visual and need some help in figuring out what went wrong ... I was trying to create a slicer with 'applyJsonFilter' API.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        msd_li.addEventListener("click", event =&amp;gt; {

          let filterText = (event.target as HTMLElement).innerText;
          console.log(filterText);

          let src=this.dataView.categorical.categories[1].source;
          console.log(src.queryName);
          const target = {
            table: src.queryName.substr(0, src.queryName.indexOf(".")),
            column:src.displayName
          };

          console.log("Table: " + target.table + "\nColumn: " + target.column);          

          let filter = new models.AdvancedFilter(target, "And", {
            operator: "Is",
            value: filterText
          });  &lt;BR /&gt;&lt;BR /&gt;          debugger;
          this.host.applyJsonFilter(filter,"general","filter",powerbi.FilterAction.merge); 
        });&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;However, when I clicked on the element I got an error on the last line: Cannot read property 'applyJsonFilter' of undefined. I might have missed some information but wasn't able to figure out which part was wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TypeError.png" style="width: 314px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/169521iEECDD92DC78A90A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="TypeError.png" alt="TypeError.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 07:43:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-Visual-Slicer-with-applyJsonFilter-API/m-p/710305#M19608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-10T07:43:04Z</dc:date>
    </item>
  </channel>
</rss>

