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
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
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