cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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: | |
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: | |

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 231 members 2,462 guests
Please welcome our newest community members: