Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
teste11234
Helper I
Helper I

Dataflow refresh limitation of Computed Entity to work on Pro Workspace

Hi guys,

I need your help on the query below.

I put the function inside the query to resolve the dataflow refresh limitation of Computed Entity to work on Pro Workspace.

But I have got this message: "We cannot convert a value of type Table to type List."

teste11234_0-1681420513212.png

 

let

  GetPageClientesFunction = (page as text) as list =>
  let
    Source = try Json.Document(Web.Contents("https://api.akhsfkjaskfjsajf.io/",
                [
                RelativePath = "v2/customers?page=" & page & "&limit=1000",
                Headers=[Authorization="jsfshfhsjfjsafasfjkakjfskj"]])) otherwise [customers=null],
    #"Converted to Table" = Table.FromRecords({Source})
  in
    #"Converted to Table",

  Source = List.Generate(
          () => [PAGE = 1, RESULTS = GetPageClientesFunction("1")],
          each Table.RowCount(Table.SelectRows([RESULTS], each [count]>0)) >0,
          each [PAGE = [PAGE] + 1, RESULTS = GetPageClientesFunction(Number.ToText([PAGE] + 1))],
          each [RESULTS]),
  #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)

in
  #"Converted to Table"
 
Many tks,
---
Alexandre.
1 ACCEPTED SOLUTION
teste11234
Helper I
Helper I

I got it, I got it... I confess, ChatGPT help me a lot. Here is the final solution.

I introduce List.Buffer and Table.Buffer to turn faster execution of the query.

let
    getPageClientes = (page as text) =>
        let
            Source = try Json.Document(Web.Contents("https://api.sensedata.io/",
            [
            RelativePath = "v2/customers?page=" & page & "&limit=1000",
            Headers=[Authorization="Bearer sadasfasfasfafasfasfasf="]
            ])) otherwise [customers=null],
            #"Converted to Table" = Table.Buffer(Table.FromRecords({Source}),[BufferMode = BufferMode.Delayed])
        in
            #"Converted to Table",
    Source = List.Buffer(List.Generate(
    () => [PAGE = 1, RESULTS = getPageClientes("1")],
    each Table.RowCount(Table.SelectRows([RESULTS], each [count]>0)) >0,
    each [PAGE = [PAGE] + 1, RESULTS = getPageClientes(Number.ToText([PAGE] + 1))],
    each [RESULTS]
    )),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandTableColumn(#"Converted to Table", "Column1", {"customers", "per_page", "current_page", "count", "next_page"}, {"customers", "per_page", "current_page", "count", "next_page"})
    in
    #"Expanded Column1"

View solution in original post

1 REPLY 1
teste11234
Helper I
Helper I

I got it, I got it... I confess, ChatGPT help me a lot. Here is the final solution.

I introduce List.Buffer and Table.Buffer to turn faster execution of the query.

let
    getPageClientes = (page as text) =>
        let
            Source = try Json.Document(Web.Contents("https://api.sensedata.io/",
            [
            RelativePath = "v2/customers?page=" & page & "&limit=1000",
            Headers=[Authorization="Bearer sadasfasfasfafasfasfasf="]
            ])) otherwise [customers=null],
            #"Converted to Table" = Table.Buffer(Table.FromRecords({Source}),[BufferMode = BufferMode.Delayed])
        in
            #"Converted to Table",
    Source = List.Buffer(List.Generate(
    () => [PAGE = 1, RESULTS = getPageClientes("1")],
    each Table.RowCount(Table.SelectRows([RESULTS], each [count]>0)) >0,
    each [PAGE = [PAGE] + 1, RESULTS = getPageClientes(Number.ToText([PAGE] + 1))],
    each [RESULTS]
    )),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandTableColumn(#"Converted to Table", "Column1", {"customers", "per_page", "current_page", "count", "next_page"}, {"customers", "per_page", "current_page", "count", "next_page"})
    in
    #"Expanded Column1"

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.