Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cmholden
Regular Visitor

VisualSetings with Empty DataView

I am developing a custom visual that on some occasions does not need any input data from the Fields and hence the DataView is empty. Using the following in capabilities.json:

 
"supportsEmptyDataView": true,
 
This works fine. 
 
The problems arises with the property settings in the update function. I have a popup dialog that allows a user to set a hidden property and then stores the result in the  visual class with:
 
this.visualHost.persistProperties(objects);
 
When I access the properties in update() with; 
 
this.visualSettings = VisualSettings.parse<VisualSettings>(dataView);
 
This again works fine if there is data in the DataView. However, with no data, only the default values are returned. I also notice that if I manually set a property as a user, the missing property then becomes available in the update method - so the data are actually there but not processed unless a data field is added or a property updated. 
I imagine that there is a call made somewhere the does this in the background i.e forces the properties to be enumerated. Is it possible to fire this programatically so that I don't have to force the user to add a dummy data field - or is there some other way of making the property available?
0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors