cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
YashS Occasional Visitor
Occasional Visitor

Page.getVisuals() funtion is not working as expected

Hello All,

 

Currently, we are working on embedding one particular visual on the HTML page, for that purpose, we have followed all the possible guidelines given on this link.

 

After getting the dashboards, reports, and pages on which user has access on, next step is to get the number of visuals which are present on that particular page.

 

For that purpose, we have written below code

 

getVisual code.png

 

After executing this code, it has returned all the pages, but on accessing the visuals which are present on the first page, it has thrown below error.

 

consoleerror.png

 

Any solutions would be really appreciable.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Page.getVisuals() funtion is not working as expected

Hi @YashS,

 

I check the link you mentioned and official document, it seems like you need to define a variable to receive specific pages before invoke its child functions.

 

For example:

 

report.getPages()
  .then(function (pages) {
    // Retrieve first page.
    var firstPage = pages[0];
 
    firstPage.getVisuals()
      .then(function (visuals) {
        console.log(visuals);
      })
  })

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Page.getVisuals() funtion is not working as expected

Hi @YashS,

 

I check the link you mentioned and official document, it seems like you need to define a variable to receive specific pages before invoke its child functions.

 

For example:

 

report.getPages()
  .then(function (pages) {
    // Retrieve first page.
    var firstPage = pages[0];
 
    firstPage.getVisuals()
      .then(function (visuals) {
        console.log(visuals);
      })
  })

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 272 members 3,304 guests
Please welcome our newest community members: