Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
PowerBI Embedded API: "too few fields" error when trying to export data

I'm using the Power Bi Embedded API to show reports to my users in a web application.

The API has an exportData() method that is designed to export either the full data or the summarized data from a visual in the report.

My problem occurs when trying to export the summarized data:

myVisual.exportData(ExportDataType.Summarized);

when I do this, this is what I get back:

enter image description here

As you can see, the returned data has a TooFewFields error, with the message Too few fields: expected 3 fields but parsed 1.

Can anyone explain what this error means, and why it is happening? I tried googling, but didn't find anything regarding this particular error.

Note that:

  • Exporting the full data, instead of the summarized one, works correctly
  • Exporting the summarized data from the UI (by clicking export data in the top right corner of the visual) works correctly
  • This seems to happen on all visuals in the report
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The "TooFewFields" error occurred because, The ‘exportData()’ method mainly consists of 2 parameters Namely Summarized Datatype and Count of Rows to be returned. But the code that you have written does not consist the parameter as expected. You have to include Models. Exportdatatype. Summarized and the row count to get the required result.

Find the below code snippet:

1.Get the page which contains visual:

    const pages = await report. getPages();
    let page = pages.filter(function (page) { 
        return page.isActive 
    })[0]; 
    const visuals = await page.getVisuals(); 

2 Find the target visual:

    let visual = visuals.filter(function (visual) { 
        return visual.name === "Required_Visual_Name"; 
    })[0]; 

3.Export data from visual:

    const result = await visual.exportData(models.ExportDataType.Summarized,100); 
    console.log(result.data); 

Output:

enter image description here

Please find the reference here for exporting summarized data: https://docs.microsoft.com/javascript/api/overview/powerbi/export-data

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!