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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TK12345
Resolver I
Resolver I

Help with syntax -'One or more table references a dynamic Data Source. Not able to save dataflow'

Hi there, 
I have an API that I want to paginate in a Power BI Dataflow. I tried this code in the desktop (dataset) and it refreshes fine. It also shows data in the dataflow but when I close the dataflow I get the error message: One or more table references a dynamic Data Source. Not able to save Dataflow. 

So I have the followings queries/functions/parameters in the dataflow:
1 parameter where I provide my BaseURL              (https://www.cannotshow.nl)

1 parameter where I provide my Bearer token        (Bearer abcdefgheijklmnop)
1 Function called TEST:

 

(currentPage as number) =>

let
    Source = Json.Document(Web.Contents(BaseURL,
                                        [RelativePath ="/test.test/rest/all/V1/orders?searchCriteria[pageSize]=10&searchCriteria[currentPage]="&Number.ToText(currentPage)] &
                                        [Headers=[Authorization=Authentication]]))

in
   Source

1 query that shows me the data:

let
  Source = List.Generate(()=>
[Result= try TEST(0) otherwise null, currentPage=0],
each [Result]<>null,
each [Result= try TEST([currentPage]+1) otherwise null, currentPage=[currentPage]+1],
each [Result]),
  #"Geconverteerd naar tabel 1" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
  #"Uitgevouwen Column1" = Table.ExpandRecordColumn(#"Geconverteerd naar tabel 1", "Column1", {"items"}, {"items"}),
  #"Uitgevouwen items" = Table.ExpandListColumn(#"Uitgevouwen Column1", "items"),
  #"Uitgevouwen items 1" = Table.ExpandRecordColumn(#"Uitgevouwen items", "items", {"weight"}, {"weight"})
in
  #"Uitgevouwen items 1"

So the question is:

WHY do I get the Can't save dataflow error? I can see the data is loaded in. Some people with the same issues fixed it by using RelativePath, but in my case it still does not work. What do I need to change in the code so my dataflow will save and refresh. 

Do I have to change something in the Relative Path or what do I need to do? Who could help me out?

 

2 ACCEPTED SOLUTIONS

Put the query pairs into the Query section, not the Relative path section.

View solution in original post

Thanks, that did the trick.

Solved it like this:

(Page as number) as table=>

let
  Source =
  Json.Document(
    Web.Contents("https://www.cannotshow.nl",
    [RelativePath = "/test.test/rest/all/V1/orders",
    Query = [
      #"searchCriteria[pageSize]" = Text.From(10),
      #"searchCriteria[currentPage]" = Number.ToText(Page)
      ],
      Headers=[
       #"Authorization" = "Bearer abcdefgheijklmnop"
    ]])

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

You specified the query as part of the RelativePath.  Try specifying it separately as the documentation suggests.

Hi Ibendlin, 

Thanks for your reply, I thought I did what the documentation suggests. What do you mean I specified the query as part of the RelativePath, and how do you suggest to change it?

Put the query pairs into the Query section, not the Relative path section.

Thanks, that did the trick.

Solved it like this:

(Page as number) as table=>

let
  Source =
  Json.Document(
    Web.Contents("https://www.cannotshow.nl",
    [RelativePath = "/test.test/rest/all/V1/orders",
    Query = [
      #"searchCriteria[pageSize]" = Text.From(10),
      #"searchCriteria[currentPage]" = Number.ToText(Page)
      ],
      Headers=[
       #"Authorization" = "Bearer abcdefgheijklmnop"
    ]])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors