<?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 retrieve Slicers Data prom power BI report in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-retrieve-Slicers-Data-prom-power-BI-report/m-p/2539600#M36336</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to retrieve the Slicers data in a power bi report from all the pages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the below code, which is provided in the url&amp;nbsp;&lt;A title="getSlicers()" href="https://docs.microsoft.com/en-us/javascript/api/powerbi/powerbi-client/page.page#powerbi-client-page-page-getfilters" target="_self"&gt;getSlicers()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;page.getSlicers()
        .then(slicers =&amp;gt; {
            debugger
            console.log(slicers);
        });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I thrown an error Uncaught (in promise) TypeError: page.getSlicers is not a function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me with a working example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 16:34:56 GMT</pubDate>
    <dc:creator>Neehar</dc:creator>
    <dc:date>2022-05-25T16:34:56Z</dc:date>
    <item>
      <title>How to retrieve Slicers Data prom power BI report</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-retrieve-Slicers-Data-prom-power-BI-report/m-p/2539600#M36336</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to retrieve the Slicers data in a power bi report from all the pages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the below code, which is provided in the url&amp;nbsp;&lt;A title="getSlicers()" href="https://docs.microsoft.com/en-us/javascript/api/powerbi/powerbi-client/page.page#powerbi-client-page-page-getfilters" target="_self"&gt;getSlicers()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;page.getSlicers()
        .then(slicers =&amp;gt; {
            debugger
            console.log(slicers);
        });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I thrown an error Uncaught (in promise) TypeError: page.getSlicers is not a function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me with a working example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 16:34:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-retrieve-Slicers-Data-prom-power-BI-report/m-p/2539600#M36336</guid>
      <dc:creator>Neehar</dc:creator>
      <dc:date>2022-05-25T16:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve Slicers Data prom power BI report</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-retrieve-Slicers-Data-prom-power-BI-report/m-p/2546397#M36395</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/329050"&gt;@Neehar&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'd like to suggest you test on the power bi playground, it shared the sample report and corresponding code snaps of each operation:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://playground.powerbi.com/en-us/dev-sandbox" target="_blank"&gt;Power BI Playground - Developer Sandbox&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;// Retrieve the page collection and get the slicers for the active page.
try {
    const pages = await report.getPages();

    // Retrieve the active page.
    let pageWithSlicer = pages.filter(function (page) {
        return page.isActive;
    })[0];

    const visuals = await pageWithSlicer.getVisuals();

    // Retrieve all visuals with the type "slicer".
    let slicers = visuals.filter(function (visual) {
        return visual.type === "slicer";
    });

    slicers.forEach(async (slicer) =&amp;gt; {
        // Get the slicer state.
        const state = await slicer.getSlicerState();
        console.log("Slicer name: \"" + slicer.name + "\"\nSlicer state:\n", state);
    });
}
catch (errors) {
    console.log(errors);
}
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 02:27:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-retrieve-Slicers-Data-prom-power-BI-report/m-p/2546397#M36395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-30T02:27:56Z</dc:date>
    </item>
  </channel>
</rss>

