<?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: Slicer can't save user inputted values when switching page. in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Slicer-can-t-save-user-inputted-values-when-switching-page/m-p/4388745#M12123</link>
    <description>&lt;P&gt;Thanks a lot! I was able to save the user input using the first method that you suggested.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2025 19:34:19 GMT</pubDate>
    <dc:creator>Sssman</dc:creator>
    <dc:date>2025-01-30T19:34:19Z</dc:date>
    <item>
      <title>Slicer can't save user inputted values when switching page.</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Slicer-can-t-save-user-inputted-values-when-switching-page/m-p/4385910#M12117</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have created this slicer with help of ChatGPT because the default range slicer wasn't providing some customizations I wanted. For the most part, it works as expected, except for one thing, when I input values to the Min and Max box, the filter works but if I switch the page and go back to the page again, the Min and Max box will not show the user inputted values but the filter will still be active.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have uploaded the files here, can someone please help me save the user input values, I would really appreciate it.&lt;BR /&gt;&lt;A href="https://github.com/suvojithaldar/CustomRangeSlicer" target="_blank"&gt;https://github.com/suvojithaldar/CustomRangeSlicer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 10:49:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Slicer-can-t-save-user-inputted-values-when-switching-page/m-p/4385910#M12117</guid>
      <dc:creator>Sssman</dc:creator>
      <dc:date>2025-01-29T10:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer can't save user inputted values when switching page.</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Slicer-can-t-save-user-inputted-values-when-switching-page/m-p/4387030#M12121</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/920510"&gt;@Sssman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like you're restoring the filter state from the visual host correctly when your visual reinitializes on page change, so at least the visuals are filtered correctly. You will have the responsibility of updating your UI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For any input elements, you'll need some logic in there to fill them in - there would be two ways I'd consider this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;If restoring from the persisted filter state is acceptable,&lt;/STRONG&gt; process your filter JSON to obtain the min and max values and make these the initial values of the corresponding input elements.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;If the exact values the user typed are what you want to store&lt;/STRONG&gt;&amp;nbsp;(as Power BI may adjust the persisted filter to suit the data and may not reflect the user's original input 100%). In this case, I'd consider this approach:
&lt;UL&gt;
&lt;LI&gt;Create properties to store the type values and persist them using the &lt;FONT face="courier new,courier"&gt;IVisualHost.persistProperties&lt;/FONT&gt; API.&lt;/LI&gt;
&lt;LI&gt;These properties can be read when your visual reinitializes and populates into the input elements similar to the above mechanism.&lt;/LI&gt;
&lt;LI&gt;Keeping these properties hidden from the user when you create your formatting model so they cannot be manually modified from the pane (this could be fine if you don't mind them being visible, but bear in mind that you'll need to 'sync' them both ways rather than assuming that they'll only be written to from the visual).&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Good luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 22:03:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Slicer-can-t-save-user-inputted-values-when-switching-page/m-p/4387030#M12121</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2025-01-29T22:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Slicer can't save user inputted values when switching page.</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Slicer-can-t-save-user-inputted-values-when-switching-page/m-p/4388745#M12123</link>
      <description>&lt;P&gt;Thanks a lot! I was able to save the user input using the first method that you suggested.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 19:34:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Slicer-can-t-save-user-inputted-values-when-switching-page/m-p/4388745#M12123</guid>
      <dc:creator>Sssman</dc:creator>
      <dc:date>2025-01-30T19:34:19Z</dc:date>
    </item>
  </channel>
</rss>

