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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Joerg
Helper I
Helper I

data flow error dynamic data source

Hello all

I have a pro licence and want to setup a data flow.

My table has a column with Id-nos from a sharepoint list.

I add a column to retrieve for each Id-no the version history from sharepoint.

In PBI desktop this works fine, but in service - when I try to save the flow - I get the error that it can't be saved because of reference to dynamic data source.

As far as I understand, this is due to the field "Id" which I use in the URL and makes it dynamic.

I searched a lot and tried to use relative path in den Web.Contents() part, but I do not get it working.

 

My script looks like this:

 

let
Source = PowerBI.Dataflows(null),
workspaceId = Source{[workspaceId="XYZ"]}[Data],
dataflowId = workspaceId{[dataflowId="ABC"]}[Data],
NPAP = dataflowId{[entity="NPAP"]}[Data],
AddColumn = Table.AddColumn(NPAP, "Xml.Tables", each Xml.Tables(Web.Contents(
"https://myaddress.sharepoint.com/sites/mysite/_api/web/Lists/getbytitle('mylist')/items("&Text.From([Id])&")/versions")))
in
AddColumn

 

How does my Web.Contents part need to be modified to get this working in PBI service ?

 

Thanks a lot for your help.

Joerg

 

 

1 ACCEPTED SOLUTION
Joerg
Helper I
Helper I

Got now help from a colleague and added the RelativePath to get it working.

 

Xml.Tables(Web.Contents("https://myaddress.sharepoint.com/sites",[RelativePath="/mysite/_api/web/Lists/getbytitle('mylist')/items("&Text.From([Id])&")/versions"]))

View solution in original post

3 REPLIES 3
Joerg
Helper I
Helper I

Got now help from a colleague and added the RelativePath to get it working.

 

Xml.Tables(Web.Contents("https://myaddress.sharepoint.com/sites",[RelativePath="/mysite/_api/web/Lists/getbytitle('mylist')/items("&Text.From([Id])&")/versions"]))

lbendlin
Super User
Super User

Needs more details. Where does the [ID] field come from in this particular Power Query? Is it  a declared parameter? or is it a result column from a previous step?  You said you have a list of IDs. Usually that list is small (sub 5000) so you could have a reference table with all IDs and then run a  "each" loop against these as you show already. 

I have a sharepoint lst and query all Id from that list.

The Id numbers are in my first column.

Then I add a column to retrieve for each Id of the first column the version history.

 

The approach I found from here:

https://community.powerbi.com/t5/Desktop/Getting-SharePoint-List-items-with-full-history-version/td-... 

 

Working fine in PBI desktop, but in a data flow it comes up with the mentioned error.

 

Thanks

Joerg

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.