Forum Discussion
How to get the options.dataViews[0] in the constructor
Hi xuyonggang,
Unless you can think within the constraints of the current visual lifecycle, and this is something you truly need, your current approach will be to create a feature request with Microsoft. There is no way to do this currently.
You can create an issue here: Issues · microsoft/PowerBI-visuals-tools (github.com)
Regards,
Daniel
Hi @dm-p, Thank you for your idea, it made me think of using updateCount to determine whether it is initialized, so that it will not be reset when the data changes.
Now I have a new question, my component is a datepicker visual, can I filter data from other pages through this visual object, similar to the official synchronous slicer function?
- dm-p2 years agoSuper User
Hi xuyonggang,
You can only leverage the functionality to restore the filter to the data view if you have enabled slicer sync. Bear in mind that this is only a valid filter that Power BI has sanitized after your visual submits it (this is not documented and I found this out the hard way). If you want to share settings or other information that is not part of a filter object, then this is not possible through conventional means due to security restrictions on visuals.
The only other way to share information between visuals in a report is to use the local storage API. Note that to get access to this, you need to contact Microsoft to specifically enable it for your visual.
Regards,
Daniel