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
Shilpa02
Frequent Visitor

visual.getCapabilities() is not working

Hi Team, 

While embedding a sinlge visual and trying to call visual.getCapabilities() , I am getting an error like it is not a function. Also while using SetAuthoringPageActive, getting error as it is not defined. PF I have installed the Microsoft.PowerBI.ReportAuthoring package.

Could anyone please advise on how to proceed this.

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Shilpa02 ,

 

Glad to hear the issue is resolved,  you can accept the right reply as solution, that way, other community members would benefit from the solution.

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi @Shilpa02 ,

 

Glad to hear the issue is resolved,  you can accept the right reply as solution, that way, other community members would benefit from the solution.

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Shilpa02
Frequent Visitor

The below seems working:

report.on('loaded', function () {
        report.getPages()
            .then(function (pages) {
                var activePage = pages.filter(function (page) {
                    return page.isActive
                })[0];
                console.log(activePage);
                activePage.getVisuals()
                    .then(function (visuals) {
                        let visual1 = visuals[visuals.length - 1];
                        console.log(visual1);

                        //getCapabilities
                        visual1.getCapabilities()
                            .then(function (capabilities) {
                            console.log(capabilities);
                            })
                            .catch(function (errors) {
                                console.log(errors);
                            });

                        //getDataFields
                        visual1.getDataFields('Y')
                            .then(function (dataFields) {
                                console.log("Visual 'Y' fields:");
                                console.log(dataFields);
                            })
                            .catch(function (errors) {
                                console.log(errors);
                            });

            })
            .catch(function (error) {
                console.log(error);
            });
    })

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
Top Kudoed Authors