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
callum
Helper II
Helper II

First call to update method has empty dataView

Hi,

 

For some reason, the very first call to my visual's update does not populate the options argument with any dataViews (and thus no data), but on subsequent calls it does. The first call also seems to have a different "type"; 62 instead of 2, although what this means I have no idea (Even the API docs don't mention a "type" property!).

 

In my update method I simply do a console.log(options), and this is what's produced after several updates (the top one is irrelevant):

 

Capture.PNG

As you can see, there's something different about the first call.

 

Here's my capabilities.json, I think it's structured correctly:

 

{
  "dataRoles": [
    {
      "displayName": "Solution areas",
      "name": "solutionAreas",
      "kind": "Grouping"
    },
    {
      "displayName": "Pillars",
      "name": "pillars",
      "kind": "Grouping"
    },
    {
      "displayName": "Statuses",
      "name": "statuses",
      "kind": "Grouping"
    },
    {
      "displayName": "Names",
      "name": "names",
      "kind": "Grouping"
    }
  ],
  "dataViewMappings": [
    {
      "table": {
        "rows": {
          "select": [
            {
              "for": {
                "in": "solutionAreas"
              }
            },
            {
              "for": {
                "in": "pillars"
              }
            },
            {
              "for": {
                "in": "statuses"
              }
            },
            {
              "for": {
                "in": "names"
              }
            }
          ]
        }
      }
    }
  ]
}

Any ideas what could be causing this? This is a brand new project so I haven't tinkered with anything really, just capabilities.json and the update method.

 

Thanks.

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

Hello @callum,

 

This is expected behavior. We face the same with all of custom visuals.

Our recommendation is to skip rendering if dataView is empty.

 

This is how we check dataView for Chiclet Slicer.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

1 REPLY 1
v-viig
Community Champion
Community Champion

Hello @callum,

 

This is expected behavior. We face the same with all of custom visuals.

Our recommendation is to skip rendering if dataView is empty.

 

This is how we check dataView for Chiclet Slicer.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

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.