<?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: getSlicerState on Inactive Pages in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/4056363#M54304</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/281951"&gt;@Nojustice&lt;/a&gt;&amp;nbsp;I have just come across the same issue. Have you found a workaround or been able to solve this?&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 12:28:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-07-23T12:28:08Z</dc:date>
    <item>
      <title>getSlicerState on Inactive Pages</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1621186#M27478</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are currently trying to implement functionality where we save the state of all slicers on a report so that when a user comes back to the report in the future, it re-renders in the state that the user left the report in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are however experiencing an issues whereby getSlicerState seems to error if retrieving slicerstates from any other page other than the active one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;See example below:-&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;const pages = await report.getPages();
for (const page of pages) {
   let theSlicers;
   let allOfTheVisuals;
   await page
        .getVisuals()
        .then((visuals) =&amp;gt; {
          allOfTheVisuals = visuals;
        })
        .catch((err) =&amp;gt; {
          console.log(`error getting the page visuals:`, err);
        });
   // Separate out the slicers from the visuals
   theSlicers = allOfTheVisuals.filter((visual) =&amp;gt; {
          return visual.type == "slicer";
        });
   const slicerFilterData = [];
      for (const slicer of theSlicers) {
        await slicer
          .getSlicerState()
          .then((filters) =&amp;gt; {
            // If there are no filters then don't add the slicer.
            if (filters === undefined || filters.length === 0) return;

            const obj: VisualLevelFilter = {
              name: slicer.name,
              type: slicer.type,
              filters: filters,
            };
            slicerFilterData.push(obj); //Does not populate this when slicers are not on active page
          })
          .catch(
            (err) =&amp;gt; {
              throw(err); //Errors here
            } 
          );
      }
}
&lt;/LI-CODE&gt;&lt;P&gt;Has anyone encountered this problem before, or does anyone have a workaround for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much Appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 14:17:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1621186#M27478</guid>
      <dc:creator>Nojustice</dc:creator>
      <dc:date>2021-01-25T14:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: getSlicerState on Inactive Pages</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1621429#M27483</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry I forgot to add the error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; {"message":"visualConfigIsNotInitialized","detailedMessage":"Visual container config is not initialized"}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 15:36:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1621429#M27483</guid>
      <dc:creator>Nojustice</dc:creator>
      <dc:date>2021-01-25T15:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: getSlicerState on Inactive Pages</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1625194#M27513</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/281951"&gt;@Nojustice&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;According to your error message, it seems like your request did not include the configs so that it failed to initialize. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If that is the case, I'd like to suggest you take a look following links about power bi javascript and correspond configurations.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/javascript/api/overview/powerbi/configure-report-settings" target="_self"&gt;Configure report settings&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details" target="_self"&gt;Embed Configuration Details&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&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>Wed, 27 Jan 2021 05:33:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1625194#M27513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-27T05:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: getSlicerState on Inactive Pages</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1635827#M27594</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have only provided an example piece of code, at the point this is executed the report is already rendered on the screen so all the configuration has already been passed to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an example the report contains 2 tabs,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tab1 = Books&lt;/P&gt;&lt;P&gt;Tab2 = Authors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user alters some slicers on Books, then moves to Authors and alters some slicers.&lt;/P&gt;&lt;P&gt;The user hits save (code in my original post is executed)&lt;/P&gt;&lt;P&gt;It seems to only getslicerstate from the slicers on the current page (in this case Authors), I want to store what the slicerstate is from Books page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this brings some more clarity&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 12:50:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1635827#M27594</guid>
      <dc:creator>Nojustice</dc:creator>
      <dc:date>2021-02-01T12:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: getSlicerState on Inactive Pages</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1640811#M27636</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/281951"&gt;@Nojustice&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;So you mean you want to add data processing methods into the requests? Did this error disappear if you remove these operations?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If that is the case, it may mean power bi not allow you to do some additional operation to send/access to the external resources.&lt;/FONT&gt;&lt;/P&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>Wed, 03 Feb 2021 06:22:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/1640811#M27636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-03T06:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: getSlicerState on Inactive Pages</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/4056363#M54304</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/281951"&gt;@Nojustice&lt;/a&gt;&amp;nbsp;I have just come across the same issue. Have you found a workaround or been able to solve this?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 12:28:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/getSlicerState-on-Inactive-Pages/m-p/4056363#M54304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-23T12:28:08Z</dc:date>
    </item>
  </channel>
</rss>

