Reply
Occasional Visitor
Posts: 1
Registered: ‎04-05-2018
Accepted Solution

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.


Accepted Solutions
Highlighted
Community Support Team
Posts: 7,505
Registered: ‎08-14-2016

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


All Replies
Highlighted
Community Support Team
Posts: 7,505
Registered: ‎08-14-2016

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: | |