Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda